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 2019/02/20 16:52:18 UTC

[GitHub] srowen commented on a change in pull request #23818: [SPARK-19591][ML][PYSPARK][FOLLOWUP] Add sample weights to decision trees

srowen commented on a change in pull request #23818: [SPARK-19591][ML][PYSPARK][FOLLOWUP] Add sample weights to decision trees
URL: https://github.com/apache/spark/pull/23818#discussion_r258577213
 
 

 ##########
 File path: python/pyspark/ml/classification.py
 ##########
 @@ -902,12 +902,12 @@ class DecisionTreeClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPred
     >>> from pyspark.ml.linalg import Vectors
     >>> from pyspark.ml.feature import StringIndexer
     >>> df = spark.createDataFrame([
-    ...     (1.0, Vectors.dense(1.0)),
-    ...     (0.0, Vectors.sparse(1, [], []))], ["label", "features"])
+    ...     (1.0, 1.0, Vectors.dense(1.0)),
 
 Review comment:
   My only nit here is that now this shows usage with weights, only, but the weight is 1. Maybe have two quick examples, one without specifying weight and one with a weight != 1?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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