Class TimeSeriesForestClassifier
- java.lang.Object
-
- ai.libs.jaicore.ml.tsc.classifier.ASimplifiedTSClassifier<java.lang.Integer>
-
- ai.libs.jaicore.ml.tsc.classifier.trees.TimeSeriesForestClassifier
-
public class TimeSeriesForestClassifier extends ASimplifiedTSClassifier<java.lang.Integer>
Time series forest classifier as described in Deng, Houtao et al. "A Time Series Forest for Classification and Feature Extraction." Inf. Sci. 239 (2013): 142-153. Consists of mutlipleTimeSeriesTreeClassifierclassifier. This classifier only supports univariate time series prediction.
-
-
Field Summary
-
Fields inherited from class ai.libs.jaicore.ml.tsc.classifier.ASimplifiedTSClassifier
classMapper, trained
-
-
Constructor Summary
Constructors Constructor Description TimeSeriesForestClassifier()Constructing an untrained ensemble of time series trees.TimeSeriesForestClassifier(TimeSeriesForestLearningAlgorithm.ITimeSeriesForestConfig config)Constructing an untrained ensemble of time series trees.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeSeriesForestLearningAlgorithmgetLearningAlgorithm(TimeSeriesDataset dataset)TimeSeriesTreeClassifier[]getTrees()Getter for the time series trees.java.lang.Integerpredict(double[] univInstance)Predicts the class of the given instance by taking the majority vote of all trees.java.util.List<java.lang.Integer>predict(TimeSeriesDataset dataset)Performs predictions based on the given instances in the given dataset.java.lang.Integerpredict(java.util.List<double[]> multivInstance)Performs a prediction based on the given multivariate list of double[] instance representation and returns the result.voidsetFeatureCaching(boolean enableFeatureCaching)voidsetMaxDepth(int maxDepth)voidsetNumberOfTrees(int numTrees)voidsetSeed(int seed)voidsetTrees(TimeSeriesTreeClassifier[] trees)Setter for the time series trees.-
Methods inherited from class ai.libs.jaicore.ml.tsc.classifier.ASimplifiedTSClassifier
checkWhetherPredictionIsPossible, getClassMapper, isTrained, setClassMapper, train
-
-
-
-
Constructor Detail
-
TimeSeriesForestClassifier
public TimeSeriesForestClassifier()
Constructing an untrained ensemble of time series trees.
-
TimeSeriesForestClassifier
public TimeSeriesForestClassifier(TimeSeriesForestLearningAlgorithm.ITimeSeriesForestConfig config)
Constructing an untrained ensemble of time series trees.
-
-
Method Detail
-
setNumberOfTrees
public void setNumberOfTrees(int numTrees)
-
setMaxDepth
public void setMaxDepth(int maxDepth)
-
setFeatureCaching
public void setFeatureCaching(boolean enableFeatureCaching)
-
setSeed
public void setSeed(int seed)
-
predict
public java.lang.Integer predict(double[] univInstance) throws PredictionExceptionPredicts the class of the given instance by taking the majority vote of all trees.- Specified by:
predictin classASimplifiedTSClassifier<java.lang.Integer>- Parameters:
univInstance- Univariate instance to be predicted- Returns:
- Returns the result of the prediction
- Throws:
PredictionException- If something fails during the prediction process.
-
predict
public java.lang.Integer predict(java.util.List<double[]> multivInstance) throws PredictionExceptionPerforms a prediction based on the given multivariate list of double[] instance representation and returns the result.- Overrides:
predictin classASimplifiedTSClassifier<java.lang.Integer>- Parameters:
multivInstance- Multivariate instance given by a list of multiple double[] time series used for the prediction- Returns:
- Returns the result of the prediction
- Throws:
PredictionException- If something fails during the prediction process.
-
predict
public java.util.List<java.lang.Integer> predict(TimeSeriesDataset dataset) throws PredictionException
Performs predictions based on the given instances in the given dataset.- Specified by:
predictin classASimplifiedTSClassifier<java.lang.Integer>- Parameters:
dataset- TheTimeSeriesDatasetfor which predictions should be made.- Returns:
- Returns the result of the predictions
- Throws:
PredictionException- If something fails during the prediction process
-
getTrees
public TimeSeriesTreeClassifier[] getTrees()
Getter for the time series trees.- Returns:
- Returns an array consisting of all forest trees.
-
setTrees
public void setTrees(TimeSeriesTreeClassifier[] trees)
Setter for the time series trees.- Parameters:
trees- Trees to be set
-
getLearningAlgorithm
public TimeSeriesForestLearningAlgorithm getLearningAlgorithm(TimeSeriesDataset dataset)
- Specified by:
getLearningAlgorithmin classASimplifiedTSClassifier<java.lang.Integer>
-
-