(&self, x: &[Vec<f64>])
| 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] |
nothing calls this directly
no outgoing calls
no test coverage detected