what is raw prediction in Logistic Regression in spark mllib?
Asked Answered
B

1

6

I have run binary logistic regression using spark mllib. As per documentation of spark mllib, RawPrediction are confidence values, which i assume probability for lcl and ucl. I am getting -ve values for RawPrediction. In what scenarios, raw prediction values can be -ve

Benedetto answered 30/4, 2017 at 18:32 Comment(0)
L
6

Raw Prediction in case of binary classification is the margin for the concerned class. For a feature vector X,

Raw prediction z = WTX
          ∴ z ⊂ (-∞,+∞)

Prediction probability =
          f(z) = 1 / ( 1 + e-z)
          f(z) ⊂ [0, 1]

Source code for raw-prediction calculation : https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala#L973

Lallans answered 24/7, 2017 at 19:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.