Spark - Forecast Prediction API (pred_proba)

Is Apache Spark an API for getting the probability of a decision tree prediction similar to the sc_it-learn pred_proba function (i.e. decision_tree.predict_proba (X))?

+3


source to share


2 answers


I was looking for this myself. I almost hacked the solution when I noticed that the api has functionality very inconvenient (at least for LogisticRegressionModel

):

You clear the threshold (with clearThreshold()

). So the prediction function does not return a label, but a base value.

The Java docs say this:



public LogisticRegressionModel clearThreshold () :: Experimental :: Resets the threshold so that the prediction returns the original forecast estimates.

FYI: The return values ​​are between 0. and 1., the default threshold is -.5, so you can easily estimate what you want to set your threshold to.

+1


source


Good morning,



This link can help you: http://spark.apache.org/docs/latest/mllib-decision-tree.html

-1


source







All Articles