Class TSClassifier<L,V,D extends TimeSeriesDataset<L>>
- java.lang.Object
-
- ai.libs.jaicore.ml.core.predictivemodel.APredictiveModel<T,V,I,D>
-
- ai.libs.jaicore.ml.core.predictivemodel.ABatchLearner<L,V,TimeSeriesInstance<L>,D>
-
- ai.libs.jaicore.ml.tsc.classifier.TSClassifier<L,V,D>
-
- Type Parameters:
L- The attribute type of the target.V- The value type of the target attribute.D- The type of the time series data set used to learn from and predict batches.
- All Implemented Interfaces:
IBatchLearner<V,TimeSeriesInstance<L>,D>,IPredictiveModel<V,TimeSeriesInstance<L>,D>
public abstract class TSClassifier<L,V,D extends TimeSeriesDataset<L>> extends ABatchLearner<L,V,TimeSeriesInstance<L>,D>
Time series classifier which can be trained and used as a predictor. Usesalgorithmto train the model parameters (if necessary).
-
-
Field Summary
Fields Modifier and Type Field Description protected ATSCAlgorithm<L,V,D,? extends TSClassifier<L,V,D>>algorithmThe algorithm object used for the training of the classifier.
-
Constructor Summary
Constructors Constructor Description TSClassifier(ATSCAlgorithm<L,V,D,? extends TSClassifier<L,V,D>> algorithm)Constructor for a time series classifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ATSCAlgorithm<L,V,D,? extends IBatchLearner<V,TimeSeriesInstance<L>,D>>getAlgorithm()Getter for the model's training algorithm object.IPredictiveModelConfigurationgetConfiguration(){@inheritDoc ABatchLearner#getConfiguration()}java.util.List<V>predict(D dataset){@inheritDoc ABatchLearner#predict(jaicore.ml.core.dataset.IDataset)}voidsetAlgorithm(ATSCAlgorithm<L,V,D,? extends IBatchLearner<V,TimeSeriesInstance<L>,D>> algorithm)Sets the training algorithm for the classifier.voidsetConfiguration(IPredictiveModelConfiguration configuration){@inheritDoc ABatchLearner#setConfiguration(IPredictiveModelConfiguration)}voidtrain(D dataset){@inheritDoc ABatchLearner#train(jaicore.ml.core.dataset.IDataset)}-
Methods inherited from class ai.libs.jaicore.ml.core.predictivemodel.APredictiveModel
getTargetType, setTargetType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.libs.jaicore.ml.core.predictivemodel.IPredictiveModel
predict
-
-
-
-
Field Detail
-
algorithm
protected ATSCAlgorithm<L,V,D extends TimeSeriesDataset<L>,? extends TSClassifier<L,V,D extends TimeSeriesDataset<L>>> algorithm
The algorithm object used for the training of the classifier.
-
-
Constructor Detail
-
TSClassifier
public TSClassifier(ATSCAlgorithm<L,V,D,? extends TSClassifier<L,V,D>> algorithm)
Constructor for a time series classifier.- Parameters:
algorithm- The algorithm object used for the training of the classifier
-
-
Method Detail
-
train
public void train(D dataset) throws TrainingException
{@inheritDoc ABatchLearner#train(jaicore.ml.core.dataset.IDataset)}- Parameters:
dataset- TheAILabeledAttributeArrayDatasetwhich should be used for the training.- Throws:
TrainingException- If something fails during the training process.
-
getAlgorithm
public ATSCAlgorithm<L,V,D,? extends IBatchLearner<V,TimeSeriesInstance<L>,D>> getAlgorithm()
Getter for the model's training algorithm object.- Returns:
- The model's training algorithm
-
setAlgorithm
public void setAlgorithm(ATSCAlgorithm<L,V,D,? extends IBatchLearner<V,TimeSeriesInstance<L>,D>> algorithm)
Sets the training algorithm for the classifier.- Parameters:
algorithm- The algorithm object used to maintain the model's parameters.
-
predict
public java.util.List<V> predict(D dataset) throws PredictionException
{@inheritDoc ABatchLearner#predict(jaicore.ml.core.dataset.IDataset)}- Parameters:
dataset- TheAILabeledAttributeArrayDatasetfor which predictions should be made.- Returns:
- The result of the predictions.
- Throws:
PredictionException- If something fails during the prediction process.
-
getConfiguration
public IPredictiveModelConfiguration getConfiguration()
{@inheritDoc ABatchLearner#getConfiguration()}- Returns:
- The
IPredictiveModelConfigurationof this model.
-
setConfiguration
public void setConfiguration(IPredictiveModelConfiguration configuration) throws ConfigurationException
{@inheritDoc ABatchLearner#setConfiguration(IPredictiveModelConfiguration)}- Throws:
ConfigurationException- If something fails during the configuration process.
-
-