spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MLnick <...@git.apache.org>
Subject [GitHub] spark pull request #18281: [SPARK-21027][ML][PYTHON] Added tunable paralleli...
Date Thu, 20 Jul 2017 08:44:07 GMT
Github user MLnick commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18281#discussion_r128456263
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -1389,11 +1389,25 @@ def test_output_columns(self):
                                              (2.0, Vectors.dense(0.5, 0.5))],
                                             ["label", "features"])
             lr = LogisticRegression(maxIter=5, regParam=0.01)
    -        ovr = OneVsRest(classifier=lr)
    +        ovr = OneVsRest(classifier=lr, parallelism=1)
             model = ovr.fit(df)
             output = model.transform(df)
             self.assertEqual(output.columns, ["label", "features", "prediction"])
     
    +    def test_parallelism_doesnt_change_output(self):
    +        df = self.spark.createDataFrame([(0.0, Vectors.dense(1.0, 0.8)),
    +                                         (1.0, Vectors.sparse(2, [], [])),
    +                                         (2.0, Vectors.dense(0.5, 0.5))],
    +                                        ["label", "features"])
    +        ovrPar1 = OneVsRest(classifier=LogisticRegression(maxIter=5, regParam=.01), parallelism=1)
    +        modelPar1 = ovrPar1.fit(df)
    +        ovrPar2 = OneVsRest(classifier=LogisticRegression(maxIter=5, regParam=.01), parallelism=2)
    +        modelPar2 = ovrPar2.fit(df)
    +        self.assertEqual(modelPar1.getPredictionCol(), modelPar2.getPredictionCol())
    +        for i, model in enumerate(modelPar1.models):
    --- End diff --
    
    Add check for intercept equality also?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message