Class LearnShapeletsClassifier
- java.lang.Object
-
- ai.libs.jaicore.ml.tsc.classifier.ASimplifiedTSClassifier<java.lang.Integer>
-
- ai.libs.jaicore.ml.tsc.classifier.shapelets.LearnShapeletsClassifier
-
public class LearnShapeletsClassifier extends ASimplifiedTSClassifier<java.lang.Integer>
LearnShapeletsClassifierpublished 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.tsc.classifier.ASimplifiedTSClassifier
classMapper, trained
-
-
Constructor Summary
Constructors Constructor Description LearnShapeletsClassifier(int K, double learningRate, double regularization, int scaleR, double minShapeLengthPercentage, int maxIter, double gamma, int seed)Constructor of theLearnShapeletsClassifier.LearnShapeletsClassifier(int K, double learningRate, double regularization, int scaleR, double minShapeLengthPercentage, int maxIter, int seed)Constructor of theLearnShapeletsClassifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LearnShapeletsLearningAlgorithmgetLearningAlgorithm(TimeSeriesDataset dataset)double[][][]getS()double[][][]getW()double[]getW0()java.lang.Integerpredict(double[] univInstance)Performs a prediction based on the given univariate double[] instance representation and returns the result.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.voidsetC(int c)Setter forcvoidsetEstimateK(boolean estimateK)Enables / disabled the parameter estimation of K within the training algorithm.voidsetMinShapeLength(int minShapeLength)Setter forLearnShapeletsClassifier#minShapeLengthvoidsetS(double[][][] s)Setter forsvoidsetW(double[][][] w)Setter forwvoidsetW0(double[] w0)Setter forw0-
Methods inherited from class ai.libs.jaicore.ml.tsc.classifier.ASimplifiedTSClassifier
checkWhetherPredictionIsPossible, getClassMapper, isTrained, setClassMapper, train
-
-
-
-
Constructor Detail
-
LearnShapeletsClassifier
public LearnShapeletsClassifier(int K, double learningRate, double regularization, int scaleR, double minShapeLengthPercentage, int maxIter, int seed)Constructor of theLearnShapeletsClassifier.- Parameters:
K- SeeLearnShapeletsLearningAlgorithm#KlearningRate- SeeLearnShapeletsLearningAlgorithm#learningRateregularization- SeeLearnShapeletsLearningAlgorithm#regularizationscaleR- SeeLearnShapeletsLearningAlgorithm#scaleRminShapeLengthPercentage- SeeLearnShapeletsLearningAlgorithm#minShapeLengthPercentagemaxIter- SeeLearnShapeletsLearningAlgorithm#maxIterseed- SeeLearnShapeletsLearningAlgorithm#seedseed- SeeLearnShapeletsLearningAlgorithm.timeout
-
LearnShapeletsClassifier
public LearnShapeletsClassifier(int K, double learningRate, double regularization, int scaleR, double minShapeLengthPercentage, int maxIter, double gamma, int seed)Constructor of theLearnShapeletsClassifier.- Parameters:
K- SeeLearnShapeletsLearningAlgorithm#KlearningRate- SeeLearnShapeletsLearningAlgorithm#learningRateregularization- SeeLearnShapeletsLearningAlgorithm#regularizationscaleR- SeeLearnShapeletsLearningAlgorithm#scaleRminShapeLengthPercentage- SeeLearnShapeletsLearningAlgorithm#minShapeLengthPercentagemaxIter- SeeLearnShapeletsLearningAlgorithm#maxIterseed- SeeLearnShapeletsLearningAlgorithm#seedgamma- SeeLearnShapeletsLearningAlgorithm#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 fors- Parameters:
s- New value to be set
-
getW
public double[][][] getW()
- Returns:
w.
-
setW
public void setW(double[][][] w)
Setter forw- Parameters:
w- New value to be set
-
getW0
public double[] getW0()
- Returns:
w0.
-
setW0
public void setW0(double[] w0)
Setter forw0- Parameters:
w0- New value to be set
-
setC
public void setC(int c)
Setter forc- Parameters:
c- New value to be set
-
setMinShapeLength
public void setMinShapeLength(int minShapeLength)
Setter forLearnShapeletsClassifier#minShapeLength- Parameters:
minShapeLength- New value to be set
-
predict
public java.lang.Integer predict(double[] univInstance) throws PredictionExceptionPerforms a prediction based on the given univariate double[] instance representation and returns the result.- Specified by:
predictin classASimplifiedTSClassifier<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 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
-
getLearningAlgorithm
public LearnShapeletsLearningAlgorithm getLearningAlgorithm(TimeSeriesDataset dataset)
- Specified by:
getLearningAlgorithmin classASimplifiedTSClassifier<java.lang.Integer>
-
-