Spark - Forecast Prediction API (pred_proba)
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 to share