You can user the BinaryClassificationEvaluator class to get both predicted classes (0/1) and probabilities. Check the following spark doc https://spark.apache.org/docs/latest/mllib-evaluation-metrics.html .
Cheers, Ardo Sent from my iPhone > On 05 May 2016, at 07:59, colin <colin...@sina.cn> wrote: > > In 2-class problems, when I use SVM, RondomForest models to do > classifications, they predict "0" or "1". > And when I use ROC to evaluate the model, sometimes I need a probability > that a record belongs to "0" or "1". > In scikit-learn, every model can do "predict" and "predict_prob", which the > last one can ouput the probability. > I find the document, and didn't found this function in MLLIB. > Does mllib has this function? > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/Mllib-using-model-to-predict-probability-tp26886.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional commands, e-mail: user-h...@spark.apache.org