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

    https://github.com/apache/spark/pull/7903#discussion_r36153134
  
    --- Diff: python/pyspark/ml/classification.py ---
    @@ -320,8 +322,13 @@ class RandomForestClassifier(JavaEstimator, 
HasFeaturesCol, HasLabelCol, HasPred
         >>> allclose(model.treeWeights, [1.0, 1.0, 1.0])
         True
         >>> test0 = sqlContext.createDataFrame([(Vectors.dense(-1.0),)], 
["features"])
    -    >>> model.transform(test0).head().prediction
    +    >>> result = model.transform(test0).head()
    +    >>> result.prediction
         0.0
    +    >>> numpy.argmax(result.probability)
    +    0
    +    >>> numpy.argmax(result.rawPrediction)
    +    0
    --- End diff --
    
    Here users may want to know the raw prediction and probability prediction 
result as the confidence measure, so I think output ```result.probability``` or 
```numpy.amax(result.probability)``` is better to demonstrate how to use this 
feature.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to