Read the equation
The raw score is the sigmoid of an intercept-plus-feature-weight sum. The implementation then maps that value through stored calibration bins, or leaves it unchanged when no bins exist. A monotone remap preserves ordering, but empirical probability accuracy still requires evaluation on data distinct from the fitting sample.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| raw | Uncalibrated logistic value |
| coef | Model coefficient |
| value | Feature value |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
hf, _ := hi.Float64()
rf, _ := rate.Float64()
m.Bins = append(m.Bins, Bin{Lo: lf, Hi: hf, EmpiricalRate: rf})
}
return m, brows.Err()
}
// Score computes the offline calibrated probability of a feature vector under a loaded model: raw =
// sigmoid(intercept + SUM coef*value), then the monotone calibration remap (an empty bin set is the identity
// map). It mirrors the serving path's math for the held out comparison; the served numbers themselves are
// computed in decimal by the ai package.
func (m Model) Score(features map[string]float64) float64 {
eta := m.Intercept
for name, v := range features {
eta += m.Coeffs[name] * v
}
raw := 1.0 / (1.0 + math.Exp(-eta))
for _, b := range m.Bins {Exact original notation
Score computes the offline calibrated probability of a feature vector under a loaded model: raw = sigmoid(intercept + SUM coef*value), then the monotone calibration remap (an empty bin set is the identity