What is the raw prediction in logistic regression in spark mllib?

I have performed binary logistic regression using spark mllib. As per the mllib spark documentation, RawPrediction are the trust values ​​I assume for lcl and ucl. I am getting -ve values ​​for RawPrediction. In what scenarios can the original forecast values ​​be -ve

+3


source to share


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







All Articles