Class LearnShapeletsClassifier


  • public class LearnShapeletsClassifier
    extends 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.
    • 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 PredictionException
        Performs a prediction based on the given univariate double[] instance representation and returns the result.
        Specified by:
        predict in class ASimplifiedTSClassifier<java.lang.Integer>
        Parameters:
        univInstance - Univariate instance given by a double vector of time series values used for the prediction
        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 PredictionException
        Performs a prediction based on the given multivariate list of double[] instance representation and returns the result.
        Overrides:
        predict in class ASimplifiedTSClassifier<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.