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 2020/03/02 08:03:01 UTC

[GitHub] [spark] zhengruifeng commented on a change in pull request #27519: [SPARK-30770][ML] avoid vector conversion in GMM.transform

zhengruifeng commented on a change in pull request #27519: [SPARK-30770][ML] avoid vector conversion in GMM.transform
URL: https://github.com/apache/spark/pull/27519#discussion_r386239057
 
 

 ##########
 File path: python/pyspark/ml/clustering.py
 ##########
 @@ -252,7 +252,7 @@ class GaussianMixture(JavaEstimator, _GaussianMixtureParams, JavaMLWritable, Jav
     >>> model.predict(df.head().features)
     2
     >>> model.predictProbability(df.head().features)
-    DenseVector([0.0, 0.4736, 0.5264])
+    DenseVector([0.0, 0.0, 1.0])
 
 Review comment:
   ![image](https://user-images.githubusercontent.com/7322292/75656008-01064e00-5c9e-11ea-945c-2c95daf1de2c.png)
   
   The result in `model.transform(df).show()` are not `DenseVector([0.0, 0.0, 1.0])`, it is about `[6.74824658670777...`;
   
   but the `model.transform(df).head()` shows `DenseVector([0.0, 0.0, 1.0])`.
   
   Is this a kind of rounding in `Vector.toString`?
   
   ![image](https://user-images.githubusercontent.com/7322292/75656394-cc46c680-5c9e-11ea-8b0a-a83b4527bf0e.png)
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

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