jsat.classifiers
Interface WarmClassifier
-
- All Superinterfaces:
- Classifier, java.lang.Cloneable, java.io.Serializable
public interface WarmClassifier extends Classifier
This interface is meant for models that support efficient warm starting from the solution of a previous model. Training with a warm start means that instead of solving the problem from scratch, the code can use a previous solution to start closer towards its goal.
Some algorithm may be able to warm start from solutions of the same form, even if they were trained by a different algorithm. Other algorithms may only be able to warm start from the same algorithm. There may also be restrictions that the warm start can only be from a solution trained on the exact same data set. The latter case is indicated by thewarmFromSameDataOnly()method.
Just because a classifier fits the type that the warm start interface states doesn't mean that it is a valid classifier to warm start from. Classifiers of the same class trained on the same data must always be valid to warm start from.
Note: The use of this class is still under development, and may change in the future.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method and Description default voidtrain(ClassificationDataSet dataSet, Classifier warmSolution)Trains the classifier and constructs a model for classification using the given data set.voidtrain(ClassificationDataSet dataSet, Classifier warmSolution, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.booleanwarmFromSameDataOnly()Some models can only be warm started from a solution trained on the exact same data set as the model it is warm starting from.-
Methods inherited from interface jsat.classifiers.Classifier
classify, clone, supportsWeightedData, train, train
-
-
-
-
Method Detail
-
warmFromSameDataOnly
boolean warmFromSameDataOnly()
Some models can only be warm started from a solution trained on the exact same data set as the model it is warm starting from. If this is the casetruewill be returned. The behavior for training on a different data set when this is defined is undefined. It may cause an error, or it may cause the algorithm to take longer or reach a worse solution.
Whentrue, it is important that the data set be unaltered - this includes mutating the values stored or re-arranging the data points within the data set.- Returns:
trueif the algorithm can only be warm started from the model trained on the exact same data set.
-
train
void train(ClassificationDataSet dataSet, Classifier warmSolution, boolean parallel)
Trains 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.- Parameters:
dataSet- the data set to train onwarmSolution- the solution to use to warm start this modelparallel-trueif the training should be done using multiple-cores,falsefor single threaded.
-
train
default void train(ClassificationDataSet dataSet, Classifier warmSolution)
Trains the classifier and constructs a model for classification using the given data set.- Parameters:
dataSet- the data set to train onwarmSolution- the solution to use to warm start this model
-
-
DataMelt 3.0 © DataMelt by jWork.ORG