Perceptron
Extends:
Perceptron learner for 2 or more classes. Uses 1-vs-all classification.
Constructor Summary
Public Constructor | ||
public |
constructor(optionsUser: Object) Constructor. |
Member Summary
Public Members | ||
public |
numErrors: *[] |
|
public |
|
Method Summary
Public Methods | ||
public |
Callback for calculating the accuracy of the classifier on the training set in intermediate steps of training |
|
public |
createClassifier(classIndex: *): * |
|
public |
train(X: *, y: *) |
Inherited Summary
From class Estimator | ||
public abstract |
Make a prediction for a data set. |
|
public abstract |
Train the supervised learning algorithm on a dataset. |
From class OneVsAllClassifier | ||
public |
classifiers: * |
|
public abstract |
createClassifier(classIndex: number): BinaryClassifier Create a binary classifier for one of the classes. |
|
public |
createClassifiers(y: Array<number>) Create all binary classifiers. |
|
public |
getClasses(): Array<number> Get the class labels corresponding with each internal class label. |
|
public |
Retrieve the individual binary one-vs-all classifiers. |
|
public |
predict(X: *): * |
|
public |
predictProba(X: Array.Array<number>): Array.Array<number> Make a probabilistic prediction for a data set. |
|
public |
trainBatch(X: Array<Array<number>>, y: Array<mixed>) Train all binary classifiers one-by-one |
|
public |
Train all binary classifiers iteration by iteration, i.e. |
Public Constructors
public constructor(optionsUser: Object) source
Constructor. Initialize class members and store user-defined options.
Params:
Name | Type | Attribute | Description |
optionsUser | Object |
|
User-defined options |
optionsUser.trackAccuracy | trackAccuracy |
|
Whether to track accuracy during the training process. This will let the perceptron keep track of the error rate on the test set in each training iteration |
Public Methods
public calculateIntermediateAccuracy() source
Callback for calculating the accuracy of the classifier on the training set in intermediate steps of training
public createClassifier(classIndex: *): * source
Create a binary classifier for one of the classes.
Override:
OneVsAllClassifier#createClassifierParams:
Name | Type | Attribute | Description |
classIndex | * |
Return:
* |
See:
- OneVsAll#createClassifier
public train(X: *, y: *) source
Train the supervised learning algorithm on a dataset.
Override:
Estimator#trainParams:
Name | Type | Attribute | Description |
X | * | ||
y | * |