| 2100 | } |
| 2101 | |
| 2102 | static double |
| 2103 | sigmoid_predict(double decision_value, double A, double B) |
| 2104 | { |
| 2105 | double fApB = decision_value * A + B; |
| 2106 | // 1-p used later; avoid catastrophic cancellation |
| 2107 | |
| 2108 | if (fApB >= 0) |
| 2109 | return std::exp(-fApB) / (1.0 + std::exp(-fApB)); |
| 2110 | return 1.0 / (1 + std::exp(fApB)); |
| 2111 | } |
| 2112 | |
| 2113 | // Method 2 from the multiclass_prob paper by Wu, Lin, and Weng |
| 2114 | static void |
no outgoing calls
no test coverage detected