PySpark & MLLib: Class Probabilities of Random Forest Predictions

后端 未结 4 1976
忘掉有多难
忘掉有多难 2021-02-03 12:19

I\'m trying to extract the class probabilities of a random forest object I have trained using PySpark. However, I do not see an example of it anywhere in the documentation, nor

4条回答
  •  忘掉有多难
    2021-02-03 13:06

    This is now available.

    Spark ML provides:

    • a predictionCol that contains the predicted label
    • and a probabilityCol that contains a vector with the probabilities for each label, this is what you where looking for!
    • You can also access the raw counts

    For more details, here is the Spark Documentation: http://spark.apache.org/docs/latest/ml-classification-regression.html#output-columns-predictions

提交回复
热议问题