import {BinaryLogisticRegression} from '@jsmlt/jsmlt/src/supervised/linear/logistic-regression.js'
BinaryLogisticRegression
Extends:
Logistic Regression learner for binary classification problem.
Member Summary
Public Members | ||
public |
weights: * |
|
public |
|
Method Summary
Public Methods | ||
public |
Check whether training has convergence when using iterative training using trainIteration. |
|
public |
Make a prediction for a data set. |
|
public |
predictProba(features: Array.Array<number>): Array.Array<number> Make a probabilistic prediction for a data set. |
|
public |
train(X: *, y: *) |
|
public |
trainIteration(X: Array<Array<number>>, y: Array<mixed>): * Train the classifier for a single iteration on the stored training data. |
Inherited Summary
From class Estimator | ||
public abstract |
Make a prediction for a data set. |
|
public abstract |
Train the supervised learning algorithm on a dataset. |
Public Methods
public checkConvergence(): boolean source
Check whether training has convergence when using iterative training using trainIteration.
public predict(features: Array.Array<number>, optionsUser: Object): Array<number> source
Make a prediction for a data set.
Override:
Estimator#predictParams:
Name | Type | Attribute | Description |
features | Array.Array<number> | Features for each data point |
|
optionsUser | Object |
|
User-defined options |
optionsUser.output | string |
|
Output for predictions. Either "classLabels" (default, output predicted class label), "raw", or "normalized" (both returning the sigmoid of the dot product of the feature vector and unit-length weights) |
public predictProba(features: Array.Array<number>): Array.Array<number> source
Make a probabilistic prediction for a data set.
Params:
Name | Type | Attribute | Description |
features | Array.Array<number> | Features for each data point |
Return:
Array.Array<number> | Probability predictions. Each array element contains the probability of the negative (0) class in the first element, and the probability of the positive (1) class in the second element |
public train(X: *, y: *) source
Train the supervised learning algorithm on a dataset.
Override:
Estimator#trainParams:
Name | Type | Attribute | Description |
X | * | ||
y | * |