Github user yanboliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18554#discussion_r129533677
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -1255,6 +1255,24 @@ def test_output_columns(self):
             output = model.transform(df)
             self.assertEqual(output.columns, ["label", "features", 
"prediction"])
     
    +    def test_support_for_weightCol(self):
    +        df = self.spark.createDataFrame([(0.0, Vectors.dense(1.0, 0.8), 
1.0),
    +                                         (1.0, Vectors.sparse(2, [], []), 
1.0),
    +                                         (2.0, Vectors.dense(0.5, 0.5), 
1.0)],
    +                                        ["label", "features", "weight"])
    +        # classifier inherits hasWeightCol
    +        lr = LogisticRegression(maxIter=5, regParam=0.01)
    +        ovr = OneVsRest(classifier=lr, weightCol="weight")
    +        self.assertIsNotNone(ovr.fit(df))
    +        ovr2 = OneVsRest(classifier=lr).setWeightCol("weight")
    --- End diff --
    
    Minor: We can remove test of ```ovr2``` and ```ovr4```, setting param in 
different way will run the same code at backend.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to