public static class LogisticRegression.Binomial extends LogisticRegression
LogisticRegression.Binomial, LogisticRegression.Multinomial
Constructor and Description |
---|
Binomial(double[] w,
double L,
double lambda,
smile.util.IntSet labels)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
coefficients()
Returns an array of size (p+1) containing the linear weights
of binary logistic regression, where p is the dimension of
feature vectors.
|
int |
predict(double[] x)
Predicts the class label of an instance.
|
int |
predict(double[] x,
double[] posteriori)
Predicts the class label of an instance and also calculate a posteriori
probabilities.
|
void |
update(double[] x,
int y)
Online update the classifier with a new training instance.
|
AIC, binomial, binomial, binomial, binomial, binomial, fit, fit, fit, fit, fit, getLearningRate, loglikelihood, multinomial, multinomial, multinomial, multinomial, multinomial, setLearningRate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
predict
update
applyAsDouble, applyAsInt, predict, score
public Binomial(double[] w, double L, double lambda, smile.util.IntSet labels)
w
- the weights.L
- the log-likelihood of learned model.lambda
- λ > 0 gives a "regularized" estimate of linear
weights which often has superior generalization performance,
especially when the dimensionality is high.labels
- class labelspublic double[] coefficients()
public int predict(double[] x)
Classifier
x
- the instance to be classified.public int predict(double[] x, double[] posteriori)
SoftClassifier
x
- an instance to be classified.posteriori
- a posteriori probabilities on output.public void update(double[] x, int y)
OnlineClassifier
x
- training instance.y
- training label.