You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/21 08:31:53 UTC

[GitHub] [spark] WeichenXu123 commented on pull request #32245: [SPARK-35142][PYTHON][ML] Fix incorrect return type for `rawPredictionUDF` in `OneVsRestModel`

WeichenXu123 commented on pull request #32245:
URL: https://github.com/apache/spark/pull/32245#issuecomment-823883887


   @harupy 
   
   Backport to branch-3.1 cause conflicts.
   Could you create a PR against apache/spark branch-3.1 ?
   
   ```
   ++<<<<<<< HEAD
    +    def test_parallelism_doesnt_change_output(self):
   ++=======
   +     def test_raw_prediction_column_is_of_vector_type(self):
   +         # SPARK-35142: `OneVsRestModel` outputs raw prediction as a string column
   +         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"])
   +         lr = LogisticRegression(maxIter=5, regParam=0.01)
   +         ovr = OneVsRest(classifier=lr, parallelism=1)
   +         model = ovr.fit(df)
   +         row = model.transform(df).head()
   +         self.assertIsInstance(row["rawPrediction"], DenseVector)
   + 
   +     def test_parallelism_does_not_change_output(self):
   ++>>>>>>> b6350f5bb0... [SPARK-35142][PYTHON][ML] Fix incorrect return type for `rawPredictionUDF` in `OneVsRestModel`
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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