What is the raw prediction in logistic regression in spark mllib?
1 answer
The raw prediction in the case of binary classification is the margin for the corresponding class. For a vector function X,
Initial prediction
& EPRS; & EPRS; & EPRS; & EPRS; & EPRS; z = WTX
∴ z ⊂ (-∞,+∞)
Forecast probability =
& EPRS; & EPRS; & EPRS; & EPRS; & EPRS;
& EPRS; & EPRS; & EPRS; & EPRS; & EPRS;f(z) = 1 / ( 1 + e-z)
f(z) ⊂ [0, 1]
Source code for calculating the original forecast: https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala#L973
+1
source to share