Class TimeSeriesForestClassifier


  • public class TimeSeriesForestClassifier
    extends ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.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 mutliple TimeSeriesTreeClassifier classifier. This classifier only supports univariate time series prediction.
    • Field Summary

      • Fields inherited from class ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier

        classMapper, trained
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TimeSeriesForestLearningAlgorithm getLearningAlgorithm​(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)  
      TimeSeriesTreeClassifier[] getTrees()
      Getter for the time series trees.
      java.lang.Integer predict​(double[] univInstance)
      Predicts the class of the given instance by taking the majority vote of all trees.
      java.util.List<java.lang.Integer> predict​(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)
      java.lang.Integer predict​(java.util.List<double[]> multivInstance)
      void setFeatureCaching​(boolean enableFeatureCaching)  
      void setMaxDepth​(int maxDepth)  
      void setNumberOfTrees​(int numTrees)  
      void setSeed​(int seed)  
      void setTrees​(TimeSeriesTreeClassifier[] trees)
      Setter for the time series trees.
      • Methods inherited from class ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier

        checkWhetherPredictionIsPossible, getClassMapper, isTrained, setClassMapper, train
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimeSeriesForestClassifier

        public TimeSeriesForestClassifier()
        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 org.api4.java.ai.ml.core.exception.PredictionException
        Predicts the class of the given instance by taking the majority vote of all trees.
        Specified by:
        predict in class ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>
        Parameters:
        univInstance - Univariate instance to be predicted
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException
      • predict

        public java.lang.Integer predict​(java.util.List<double[]> multivInstance)
                                  throws org.api4.java.ai.ml.core.exception.PredictionException
        Overrides:
        predict in class ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException
      • predict

        public java.util.List<java.lang.Integer> predict​(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)
                                                  throws org.api4.java.ai.ml.core.exception.PredictionException
        Specified by:
        predict in class ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>
        Throws:
        org.api4.java.ai.ml.core.exception.PredictionException
      • 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​(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)
        Specified by:
        getLearningAlgorithm in class ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>