Class LearnShapeletsClassifier


  • public class LearnShapeletsClassifier
    extends ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>
    LearnShapeletsClassifier published in "J. Grabocka, N. Schilling, M. Wistuba, L. Schmidt-Thieme: Learning Time-Series Shapelets" (https://www.ismll.uni-hildesheim.de/pub/pdfs/grabocka2014e-kdd.pdf). 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
      LearnShapeletsLearningAlgorithm getLearningAlgorithm​(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)  
      double[][][] getS()  
      double[][][] getW()  
      double[] getW0()  
      java.lang.Integer predict​(double[] univInstance)
      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 setC​(int c)
      Setter for c
      void setEstimateK​(boolean estimateK)
      Enables / disabled the parameter estimation of K within the training algorithm.
      void setMinShapeLength​(int minShapeLength)
      Setter for LearnShapeletsClassifier#minShapeLength
      void setS​(double[][][] s)
      Setter for s
      void setW​(double[][][] w)
      Setter for w
      void setW0​(double[] w0)
      Setter for w0
      • 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

      • LearnShapeletsClassifier

        public LearnShapeletsClassifier​(int K,
                                        double learningRate,
                                        double regularization,
                                        int scaleR,
                                        double minShapeLengthPercentage,
                                        int maxIter,
                                        int seed)
        Constructor of the LearnShapeletsClassifier.
        Parameters:
        K - See LearnShapeletsLearningAlgorithm#K
        learningRate - See LearnShapeletsLearningAlgorithm#learningRate
        regularization - See LearnShapeletsLearningAlgorithm#regularization
        scaleR - See LearnShapeletsLearningAlgorithm#scaleR
        minShapeLengthPercentage - See LearnShapeletsLearningAlgorithm#minShapeLengthPercentage
        maxIter - See LearnShapeletsLearningAlgorithm#maxIter
        seed - See LearnShapeletsLearningAlgorithm#seed
        seed - See LearnShapeletsLearningAlgorithm.timeout
      • LearnShapeletsClassifier

        public LearnShapeletsClassifier​(int K,
                                        double learningRate,
                                        double regularization,
                                        int scaleR,
                                        double minShapeLengthPercentage,
                                        int maxIter,
                                        double gamma,
                                        int seed)
        Constructor of the LearnShapeletsClassifier.
        Parameters:
        K - See LearnShapeletsLearningAlgorithm#K
        learningRate - See LearnShapeletsLearningAlgorithm#learningRate
        regularization - See LearnShapeletsLearningAlgorithm#regularization
        scaleR - See LearnShapeletsLearningAlgorithm#scaleR
        minShapeLengthPercentage - See LearnShapeletsLearningAlgorithm#minShapeLengthPercentage
        maxIter - See LearnShapeletsLearningAlgorithm#maxIter
        seed - See LearnShapeletsLearningAlgorithm#seed
        gamma - See LearnShapeletsLearningAlgorithm#gamma
    • Method Detail

      • setEstimateK

        public void setEstimateK​(boolean estimateK)
        Enables / disabled the parameter estimation of K within the training algorithm.
        Parameters:
        estimateK - Value to be set
      • getS

        public double[][][] getS()
        Returns:
        s.
      • setS

        public void setS​(double[][][] s)
        Setter for s
        Parameters:
        s - New value to be set
      • getW

        public double[][][] getW()
        Returns:
        w.
      • setW

        public void setW​(double[][][] w)
        Setter for w
        Parameters:
        w - New value to be set
      • getW0

        public double[] getW0()
        Returns:
        w0.
      • setW0

        public void setW0​(double[] w0)
        Setter for w0
        Parameters:
        w0 - New value to be set
      • setC

        public void setC​(int c)
        Setter for c
        Parameters:
        c - New value to be set
      • setMinShapeLength

        public void setMinShapeLength​(int minShapeLength)
        Setter for LearnShapeletsClassifier#minShapeLength
        Parameters:
        minShapeLength - New value to be set
      • predict

        public java.lang.Integer predict​(double[] univInstance)
                                  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
      • 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
      • getLearningAlgorithm

        public LearnShapeletsLearningAlgorithm 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>