jsat.classifiers
Class BaseUpdateableClassifier
- java.lang.Object
-
- jsat.classifiers.BaseUpdateableClassifier
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier, UpdateableClassifier
- Direct Known Subclasses:
- ALMA2, ALMA2K, AODE, AROW, BOGD, CSKLR, DUOL, Forgetron, LinearSGD, MultinomialNaiveBayes, NaiveBayesUpdateable, NHERD, ODE, OnlineAMM, OSKL, Projectron, ROMMA, SCW, SPA, STGD
public abstract class BaseUpdateableClassifier extends java.lang.Object implements UpdateableClassifier
A base implementation of the UpdateableClassifier.#train(jsat.classifiers.ClassificationDataSet, java.util.concurrent.ExecutorService)will simply calltrain(jsat.classifiers.ClassificationDataSet), which will callUpdateableClassifier.setUp(jsat.classifiers.CategoricalData[], int, jsat.classifiers.CategoricalData)and then callUpdateableClassifier.update(jsat.classifiers.DataPoint, int)for each data point in a random order.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BaseUpdateableClassifier()Default constructor that does nothingBaseUpdateableClassifier(BaseUpdateableClassifier toCopy)Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract UpdateableClassifierclone()intgetEpochs()Returns the number of epochs used for trainingvoidsetEpochs(int epochs)Sets the number of whole iterations through the training set that will be performed for trainingvoidtrain(ClassificationDataSet dataSet)Trains the classifier and constructs a model for classification using the given data set.voidtrain(ClassificationDataSet dataSet, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.static voidtrainEpochs(ClassificationDataSet dataSet, UpdateableClassifier toTrain, int epochs)Performs training on an updateable classifier by going over the whole data set in random order one observation at a time, multiple times.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.classifiers.UpdateableClassifier
setUp, update
-
Methods inherited from interface jsat.classifiers.Classifier
classify, supportsWeightedData
-
-
-
-
Constructor Detail
-
BaseUpdateableClassifier
public BaseUpdateableClassifier()
Default constructor that does nothing
-
BaseUpdateableClassifier
public BaseUpdateableClassifier(BaseUpdateableClassifier toCopy)
Copy constructor- Parameters:
toCopy- object to copy
-
-
Method Detail
-
setEpochs
public void setEpochs(int epochs)
Sets the number of whole iterations through the training set that will be performed for training- Parameters:
epochs- the number of whole iterations through the data set
-
getEpochs
public int getEpochs()
Returns the number of epochs used for training- Returns:
- the number of epochs used for training
-
train
public void train(ClassificationDataSet dataSet, boolean parallel)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.- Specified by:
trainin interfaceClassifier- Parameters:
dataSet- the data set to train onparallel-trueif multiple threads should be used to train the model.falseif it should be done in a single threaded manner.
-
train
public void train(ClassificationDataSet dataSet)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set.- Specified by:
trainin interfaceClassifier- Parameters:
dataSet- the data set to train on
-
trainEpochs
public static void trainEpochs(ClassificationDataSet dataSet, UpdateableClassifier toTrain, int epochs)
Performs training on an updateable classifier by going over the whole data set in random order one observation at a time, multiple times.- Parameters:
dataSet- the data set to train fromtoTrain- the classifier to trainepochs- the number of passes through the data set
-
clone
public abstract UpdateableClassifier clone()
- Specified by:
clonein interfaceClassifier- Specified by:
clonein interfaceUpdateableClassifier- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG