MCPcopy Create free account
hub / github.com/Open-Quant/openquant / predict_proba

Method predict_proba

crates/openquant/tests/hyperparameter_tuning.rs:56–65  ·  view source on GitHub ↗
(&self, x: &[Vec<f64>])

Source from the content-addressed store, hash-verified

54 }
55
56 fn predict_proba(&self, x: &[Vec<f64>]) -> Vec<f64> {
57 x.iter()
58 .map(|row| {
59 let z = (row[0] - self.threshold) * self.sharpness;
60 let logistic = 1.0 / (1.0 + (-z).exp());
61 // Blend threshold behavior with class prior learned from weighted fit.
62 (0.85 * logistic + 0.15 * self.trained_prior).clamp(0.0, 1.0)
63 })
64 .collect()
65 }
66}
67
68#[test]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected