Class ShapeletTransformTSClassifier
- java.lang.Object
-
- ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>
-
- ai.libs.jaicore.ml.weka.classification.timeseries.learner.shapelets.ShapeletTransformTSClassifier
-
public class ShapeletTransformTSClassifier extends ai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>Class for a ShapeletTransform classifier as described in Jason Lines, Luke M. Davis, Jon Hills, and Anthony Bagnall. 2012. A shapelet transform for time series classification. In Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining (KDD '12). ACM, New York, NY, USA, 289-297. The classifier model is built of shapelets which are used for the transformation of instances to the new feature space built by the shapelets as dimensions. The feature values are the minimum distances of a time series to the feature dimension's shapelet. An ensemble classifier trained on the derived representation is then used for prediction. This classifier only supports univariate time series prediction.
-
-
Constructor Summary
Constructors Constructor Description ShapeletTransformTSClassifier(int k, int seed)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction and theFStatquality measure.ShapeletTransformTSClassifier(int k, int numClusters, ai.libs.jaicore.ml.classification.singlelabel.timeseries.quality.IQualityMeasure qm, int seed, boolean clusterShapelets)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction (ifclusterShapeletsis true and the quality measure functionqm.ShapeletTransformTSClassifier(int k, int numClusters, ai.libs.jaicore.ml.classification.singlelabel.timeseries.quality.IQualityMeasure qm, int seed, boolean clusterShapelets, int minShapeletLength, int maxShapeletLength, boolean useHIVECOTEEnsemble, int numFolds)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction (ifclusterShapeletsis true and the quality measure functionqm.ShapeletTransformTSClassifier(int k, ai.libs.jaicore.ml.classification.singlelabel.timeseries.quality.IQualityMeasure qm, int seed, boolean clusterShapelets)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction (ifclusterShapeletsis true and the quality measure functionqm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShapeletTransformLearningAlgorithmgetLearningAlgorithm(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)ai.libs.jaicore.ml.classification.singlelabel.timeseries.shapelets.search.AMinimumDistanceSearchStrategygetMinDistanceSearchStrategy()Getter forminDistanceSearchStrategy.java.util.List<ai.libs.jaicore.ml.classification.singlelabel.timeseries.shapelets.Shapelet>getShapelets()Getter forshapelets.java.lang.Integerpredict(double[] univInstance)java.util.List<java.lang.Integer>predict(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)java.lang.Integerpredict(java.util.List<double[]> multivInstance)voidsetClassifier(weka.classifiers.Classifier classifier)Setter forclassifier.voidsetShapelets(java.util.List<ai.libs.jaicore.ml.classification.singlelabel.timeseries.shapelets.Shapelet> shapelets)Setter forshapelets.
-
-
-
Constructor Detail
-
ShapeletTransformTSClassifier
public ShapeletTransformTSClassifier(int k, int seed)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction and theFStatquality measure.- Parameters:
k- Number of shapelets searched for and used as shapelet clustering inputseed- Seed for randomized operations
-
ShapeletTransformTSClassifier
public ShapeletTransformTSClassifier(int k, ai.libs.jaicore.ml.classification.singlelabel.timeseries.quality.IQualityMeasure qm, int seed, boolean clusterShapelets)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction (ifclusterShapeletsis true and the quality measure functionqm.- Parameters:
k- Number of shapelets searched for and used as shapelet clustering input if enabledqm- Quality measure function to be used to assess shapeletsseed- See for randomized operationsclusterShapelets- Indicator whether shapelet clustering should be used after extracting the best k shapelets
-
ShapeletTransformTSClassifier
public ShapeletTransformTSClassifier(int k, int numClusters, ai.libs.jaicore.ml.classification.singlelabel.timeseries.quality.IQualityMeasure qm, int seed, boolean clusterShapelets)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction (ifclusterShapeletsis true and the quality measure functionqm.- Parameters:
k- Number of shapelets searched for and used as shapelet clustering input if enablednumClusters- Number of clusters into which the shapelets are clusteredqm- Quality measure function to be used to assess shapeletsseed- See for randomized operationsclusterShapelets- Indicator whether shapelet clustering should be used after extracting the best k shapelets
-
ShapeletTransformTSClassifier
public ShapeletTransformTSClassifier(int k, int numClusters, ai.libs.jaicore.ml.classification.singlelabel.timeseries.quality.IQualityMeasure qm, int seed, boolean clusterShapelets, int minShapeletLength, int maxShapeletLength, boolean useHIVECOTEEnsemble, int numFolds)Constructs an Shapelet Transform classifier usingkshapelets, k/2 clusters of the shapelets after shapelet extraction (ifclusterShapeletsis true and the quality measure functionqm.minShapeletLengthandmaxShapeletLengthspecify the shapelet length borders, whileuseHIVECOTEEnsembledefines whether the HIVE COTE ensemble or the CAWPE ensemble should be used.- Parameters:
k- Number of shapelets searched for and used as shapelet clustering input if enabledqm- Quality measure function to be used to assess shapeletsseed- See for randomized operationsclusterShapelets- Indicator whether shapelet clustering should be used after extracting the best k shapeletsminShapeletLength- The minimal length of the shapeletsmaxShapeletLength- The maximal length of the shapeletsuseHIVECOTEEnsemble- Indicator whether the HIVE COTE ensemble should be used (CAWPE otherwise)timeout- The timeout used for the trainingnumFolds- SeeShapeletTransformLearningAlgorithm#numFolds
-
-
Method Detail
-
getShapelets
public java.util.List<ai.libs.jaicore.ml.classification.singlelabel.timeseries.shapelets.Shapelet> getShapelets()
Getter forshapelets.- Returns:
- The actual list of shapelets used for the transformation
-
setShapelets
public void setShapelets(java.util.List<ai.libs.jaicore.ml.classification.singlelabel.timeseries.shapelets.Shapelet> shapelets)
Setter forshapelets.- Parameters:
shapelets- The new list of shapelets to be set
-
setClassifier
public void setClassifier(weka.classifiers.Classifier classifier)
Setter forclassifier.- Parameters:
classifier- The classifier to be set
-
predict
public java.lang.Integer predict(double[] univInstance) throws org.api4.java.ai.ml.core.exception.PredictionException- Specified by:
predictin classai.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:
predictin classai.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:
predictin classai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>- Throws:
org.api4.java.ai.ml.core.exception.PredictionException
-
getMinDistanceSearchStrategy
public ai.libs.jaicore.ml.classification.singlelabel.timeseries.shapelets.search.AMinimumDistanceSearchStrategy getMinDistanceSearchStrategy()
Getter forminDistanceSearchStrategy.- Returns:
- the minDistanceSearchStrategy
-
getLearningAlgorithm
public ShapeletTransformLearningAlgorithm getLearningAlgorithm(ai.libs.jaicore.ml.classification.singlelabel.timeseries.dataset.TimeSeriesDataset2 dataset)
- Specified by:
getLearningAlgorithmin classai.libs.jaicore.ml.classification.singlelabel.timeseries.learner.ASimplifiedTSClassifier<java.lang.Integer>
-
-