MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / P

Method P

JSAT/src/jsat/classifiers/boosting/LogitBoost.java:200–215  ·  view source on GitHub ↗

Returns the probability that a given data point belongs to class 1 @param x the data point in question @return P(y = 1 | x)

(DataPoint x)

Source from the content-addressed store, hash-verified

198 * @return P(y = 1 | x)
199 */
200 protected double P(DataPoint x)
201 {
202 /**
203 * F(x)
204 * e
205 * p(x) = ---------------
206 * F(x) - F(x)
207 * e + e
208 */
209 double fx = F(x);
210 double efx = Math.exp(fx);
211 double enfx = Math.exp(-fx);
212 if(Double.isInfinite(efx) && efx > 0 && enfx < 1e-15)//Well classified point could return a Infinity which turns into NaN
213 return 1.0;
214 return efx/(efx + enfx);
215 }
216
217 public boolean supportsWeightedData()
218 {

Callers 2

classifyMethod · 0.95
trainCMethod · 0.95

Calls 2

FMethod · 0.95
expMethod · 0.80

Tested by

no test coverage detected