@Override
protected void train(List<?> features, int label) {
final float y = label > 0 ? 1.f : -1.f;
PredictionResult margin = calcScoreAndVariance(features);
float p = margin.getScore();
float loss = loss(p, y); // C - m (m = y * p)
if(loss > 0.f) {// m < 1.0 || 1.0 - m > 0
float var = margin.getVariance();
float beta = 1.f / (var + r);
float alpha = loss * beta; // (1.f - m) * beta
update(features, y, alpha, beta);
}
}