(&self, x: &[Vec<f64>])
| 25 | |
| 26 | impl ClassificationPredictor for NonLinearClsModel { |
| 27 | fn predict_proba(&self, x: &[Vec<f64>]) -> Vec<f64> { |
| 28 | x.iter() |
| 29 | .map(|r| { |
| 30 | let z = 1.5 * r[0] + 0.8 * r[1] * r[1] + 0.5 * r[0] * r[2] - 0.2 * r[3]; |
| 31 | 1.0 / (1.0 + (-z).exp()) |
| 32 | }) |
| 33 | .collect() |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | fn synthetic_x(n: usize, p: usize) -> Vec<Vec<f64>> { |
no outgoing calls
no test coverage detected