public class ShapeletTransformLearningAlgorithm extends ASimplifiedTSCLearningAlgorithm<java.lang.Integer,ShapeletTransformTSClassifier>
| Modifier and Type | Class and Description |
|---|---|
static interface |
ShapeletTransformLearningAlgorithm.IShapeletTransformLearningAlgorithmConfig |
| Constructor and Description |
|---|
ShapeletTransformLearningAlgorithm(ShapeletTransformLearningAlgorithm.IShapeletTransformLearningAlgorithmConfig config,
ShapeletTransformTSClassifier classifier,
TimeSeriesDataset dataset,
IQualityMeasure qualityMeasure)
Constructs a training algorithm for the
ShapeletTransformTSClassifier
classifier specified by the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
ShapeletTransformTSClassifier |
call()
Training procedure for
ShapeletTransformTSClassifier using the
training algorithm described in the paper. |
java.util.List<Shapelet> |
clusterShapelets(java.util.List<Shapelet> shapelets,
int noClusters,
long beginTime)
Clusters the given
shapelets into noClusters
clusters (cf. algorithm 6 of the original paper). |
java.util.List<java.lang.Double> |
findDistances(Shapelet s,
double[][] matrix)
Function finding the minimum single squared Euclidean distance for each
instance among all of its subsequences compared to the shapelet
s. |
static java.util.Set<Shapelet> |
generateCandidates(double[] data,
int l,
int candidateIndex)
Function generation shapelet candidates for a given instance vector
data, the length l and the candidate index which is
used to identify the source of the shapelet's data. |
ShapeletTransformLearningAlgorithm.IShapeletTransformLearningAlgorithmConfig |
getConfig() |
AMinimumDistanceSearchStrategy |
getMinDistanceSearchStrategy()
Getter for
minDistanceSearchStrategy. |
static java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> |
merge(int k,
java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> kShapelets,
java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> shapelets)
Function merging shapelet lists based on their quality scores.
|
ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent |
nextWithException() |
void |
registerListener(java.lang.Object listener) |
static java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> |
removeSelfSimilar(java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> shapelets)
Function removing self-similar shapelets from a list storing shapelet and
their quality entries.
|
void |
setMinDistanceSearchStrategy(AMinimumDistanceSearchStrategy minDistanceSearchStrategy)
Setter for
minDistanceSearchStrategy. |
static double[] |
shapeletTransform(double[] instance,
java.util.List<Shapelet> shapelets,
AMinimumDistanceSearchStrategy searchStrategy)
Function transforming the given
instance into the new feature
space spanned by the shapelets. |
static TimeSeriesDataset |
shapeletTransform(TimeSeriesDataset dataSet,
java.util.List<Shapelet> shapelets,
ai.libs.jaicore.basic.TimeOut timeout,
long beginTime,
AMinimumDistanceSearchStrategy searchStrategy)
Performs a shapelet transform on a complete
dataSet. |
cancel, getClassifier, hasNext, iterator, nextactivate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getId, getInput, getLoggerName, getNumCPUs, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeouted, post, registerActiveThread, resolveShutdownInterruptOnCurrentThread, setConfig, setLoggerName, setMaxNumThreads, setNumCPUs, setState, setTimeout, setTimeout, setTimeoutPrecautionOffset, shutdown, terminate, unregisterActiveThread, unregisterThreadAndShutdownpublic ShapeletTransformLearningAlgorithm(ShapeletTransformLearningAlgorithm.IShapeletTransformLearningAlgorithmConfig config, ShapeletTransformTSClassifier classifier, TimeSeriesDataset dataset, IQualityMeasure qualityMeasure)
ShapeletTransformTSClassifier
classifier specified by the given parameters.qualityMeasure - Quality measure used to assess the shapeletspublic ShapeletTransformTSClassifier call() throws ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException, java.lang.InterruptedException
ShapeletTransformTSClassifier using the
training algorithm described in the paper.ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException - Thrown if the training could not be finishedjava.lang.InterruptedExceptionpublic java.util.List<Shapelet> clusterShapelets(java.util.List<Shapelet> shapelets, int noClusters, long beginTime) throws java.lang.InterruptedException
shapelets into noClusters
clusters (cf. algorithm 6 of the original paper).shapelets - Shapelets to be clustered.noClusters - Number of clusters to be used, i. e. the size of the output listbeginTime - Begin time of the training execution used for the timeout checksjava.lang.InterruptedException - Thrown when a timeout occurredpublic static java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> merge(int k, java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> kShapelets, java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> shapelets)
k - Number of elements to be retainedkShapelets - The previous best shapeletsshapelets - The new shapelets to be added to the top-k listpublic static java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> removeSelfSimilar(java.util.List<java.util.Map.Entry<Shapelet,java.lang.Double>> shapelets)
isSelfSimilar(Shapelet, Shapelet).shapelets - Shapelets to be comparedshapelets list which does not
contain any self-similar shapeletspublic java.util.List<java.lang.Double> findDistances(Shapelet s, double[][] matrix)
s.s - Shapelet which is compared to the instancesmatrix - Matrix storing the data instance vectorspublic static java.util.Set<Shapelet> generateCandidates(double[] data, int l, int candidateIndex)
data, the length l and the candidate index which is
used to identify the source of the shapelet's data.data - Data vector from which the values are extractedl - The length of the generated candidate shapeletcandidateIndex - Instance index which is used to identify the generated shapeletslpublic static TimeSeriesDataset shapeletTransform(TimeSeriesDataset dataSet, java.util.List<Shapelet> shapelets, ai.libs.jaicore.basic.TimeOut timeout, long beginTime, AMinimumDistanceSearchStrategy searchStrategy) throws java.lang.InterruptedException
dataSet. See
ShapeletTransformLearningAlgorithm#shapeletTransform(double[], List).dataSet - Data set to be transformedshapelets - Shapelets used as new feature dimensionstimeout - Timeout compared to the current time difference to the
beginTimebeginTime - System time in ms when the training algorithm has startedsearchStrategy - Search strategy used to find the minimum distance from a shapelet
to the time seriesjava.lang.InterruptedException - Thrown if there was a timeoutpublic static double[] shapeletTransform(double[] instance,
java.util.List<Shapelet> shapelets,
AMinimumDistanceSearchStrategy searchStrategy)
instance into the new feature
space spanned by the shapelets. Uses the minimum squared Euclidean distance
of the corresponding shapelets to the instance as feature values.instance - The instance to be transformedshapelets - The shapelets to be used as new feature dimensionssearchStrategy - Search strategy used to find the minimum distance from a shapelet
to the time seriespublic AMinimumDistanceSearchStrategy getMinDistanceSearchStrategy()
minDistanceSearchStrategy.public void setMinDistanceSearchStrategy(AMinimumDistanceSearchStrategy minDistanceSearchStrategy)
minDistanceSearchStrategy.minDistanceSearchStrategy - the minDistanceSearchStrategy to setpublic void registerListener(java.lang.Object listener)
registerListener in interface ai.libs.jaicore.basic.algorithm.IAlgorithm<TimeSeriesDataset,ShapeletTransformTSClassifier>registerListener in class ASimplifiedTSCLearningAlgorithm<java.lang.Integer,ShapeletTransformTSClassifier>public ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent nextWithException()
nextWithException in interface ai.libs.jaicore.basic.algorithm.IAlgorithm<TimeSeriesDataset,ShapeletTransformTSClassifier>nextWithException in class ASimplifiedTSCLearningAlgorithm<java.lang.Integer,ShapeletTransformTSClassifier>public ShapeletTransformLearningAlgorithm.IShapeletTransformLearningAlgorithmConfig getConfig()
getConfig in interface ai.libs.jaicore.basic.algorithm.IAlgorithm<TimeSeriesDataset,ShapeletTransformTSClassifier>getConfig in class ai.libs.jaicore.basic.algorithm.AAlgorithm<TimeSeriesDataset,ShapeletTransformTSClassifier>