Description
if needed, method getThreshold and/or following logic to compute rawThreshold is called on each instance.
override def getThreshold: Double = { checkThresholdConsistency() if (isSet(thresholds)) { val ts = $(thresholds) require(ts.length == 2, "Logistic Regression getThreshold only applies to" + " binary classification, but thresholds has length != 2. thresholds: " + ts.mkString(",")) 1.0 / (1.0 + ts(0) / ts(1)) } else { $(threshold) } }
val rawThreshold = if (t == 0.0) { Double.NegativeInfinity } else if (t == 1.0) { Double.PositiveInfinity } else { math.log(t / (1.0 - t)) }