| 183 | } |
| 184 | |
| 185 | float_type sigmoidPredict(float_type dec_value, float_type A, float_type B) { |
| 186 | double fApB = dec_value * A + B; |
| 187 | // 1-p used later; avoid catastrophic cancellation |
| 188 | if (fApB >= 0) |
| 189 | return exp(-fApB) / (1.0 + exp(-fApB)); |
| 190 | else |
| 191 | return 1.0 / (1 + exp(fApB)); |
| 192 | } |
| 193 | |
| 194 | void SVC::multiclass_probability(const vector<vector<float_type> > &r, vector<float_type> &p) const { |
| 195 | int nrClass = n_classes; |