Class LogisticRegression
java.lang.Object
ai.beestream.jitnn.ml.LogisticRegression
L2-regularised logistic regression fitted with L-BFGS, after scikit-learn's LogisticRegression
(lbfgs): it minimises C sum_i loss_i + ||W||^2 / 2 with the intercept unpenalised; a sigmoid for
two classes, the multinomial (softmax) loss for more.
-
Constructor Summary
ConstructorsConstructorDescriptionA classifier with C 1 and 500 iterations.LogisticRegression(float c, int maxIter) A classifier with inverse regularisation strengthcand at mostmaxIterL-BFGS iterations. -
Method Summary
Modifier and TypeMethodDescriptioncoef()Coefficients [1, d] for two classes, [c, d] otherwise.The decision values x W^T + b of each sample.Fits samples x [n, features] and labels y.The intercepts, one per row of the weights.int[]The most probable label of each sample.Class probabilities [m, c].
-
Constructor Details
-
LogisticRegression
public LogisticRegression(float c, int maxIter) A classifier with inverse regularisation strengthcand at mostmaxIterL-BFGS iterations. -
LogisticRegression
public LogisticRegression()A classifier with C 1 and 500 iterations.
-
-
Method Details
-
fit
Fits samples x [n, features] and labels y. -
coef
Coefficients [1, d] for two classes, [c, d] otherwise. -
intercept
The intercepts, one per row of the weights. -
decisionFunction
-
predictProba
-
predict
The most probable label of each sample.
-