public class LearnPatternSimilarityClassifier extends ASimplifiedTSClassifier<java.lang.Integer>
classMapper, trained| Constructor and Description |
|---|
LearnPatternSimilarityClassifier(int seed,
int numTrees,
int maxTreeDepth,
int numSegments)
Standard constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
findNearestInstanceIndex(int[][] leafNodeCounts)
Performs a simple nearest neighbor search on the stored
trainLeafNodes for the given leafNodeCounts using
Manhattan distance. |
java.util.List<weka.core.Attribute> |
getAttributes() |
int[] |
getClassAttIndexPerTree() |
LearnPatternSimilarityLearningAlgorithm |
getLearningAlgorithm(TimeSeriesDataset dataset) |
int[] |
getLengthPerTree() |
int[][] |
getSegments() |
int[][] |
getSegmentsDifference() |
int[][][] |
getTrainLeafNodes() |
int[] |
getTrainTargets() |
AccessibleRandomTree[] |
getTrees() |
java.lang.Integer |
predict(double[] univInstance)
Predicts the class by generated segment and segment difference features based
on
segments and segmentsDifference. |
java.lang.Integer |
predict(java.util.List<double[]> multivInstance)
Performs a prediction based on the given multivariate list of 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.
|
void |
setAttributes(java.util.List<weka.core.Attribute> attributes) |
void |
setClassAttIndexPerTree(int[] classAttIndexPerTree) |
void |
setLengthPerTree(int[] lengthPerTree) |
void |
setSegments(int[][] segments) |
void |
setSegmentsDifference(int[][] segmentsDifference) |
void |
setTrainLeafNodes(int[][][] trainLeafNodes) |
void |
setTrainTargets(int[] trainTargets) |
void |
setTrees(AccessibleRandomTree[] trees) |
checkWhetherPredictionIsPossible, getClassMapper, isTrained, setClassMapper, trainpublic LearnPatternSimilarityClassifier(int seed,
int numTrees,
int maxTreeDepth,
int numSegments)
seed - Seed used for randomized operationsnumTrees - Number of trees being trainedmaxTreeDepth - Maximum depth of the trained treesnumSegments - Number of segments used per tree for feature generationpublic java.lang.Integer predict(double[] univInstance)
throws PredictionException
segments and segmentsDifference. The induced
instances are propagated to the forest of RandomRegressionTrees
trees. The predicted leaf nodes are used within a 1NN search on
the training leaf nodes to find the nearest instance and taking its class as
prediction value.predict in class ASimplifiedTSClassifier<java.lang.Integer>univInstance - Univariate instance to be predictedPredictionException - If something fails during the prediction process.public int findNearestInstanceIndex(int[][] leafNodeCounts)
trainLeafNodes for the given leafNodeCounts using
Manhattan distance.leafNodeCounts - Leaf node counts induced during the prediction phasepublic java.lang.Integer predict(java.util.List<double[]> multivInstance)
throws PredictionException
predict in class ASimplifiedTSClassifier<java.lang.Integer>multivInstance - Multivariate instance given by a list of multiple
double[] time series used for the predictionPredictionException - If something fails during the prediction process.public java.util.List<java.lang.Integer> predict(TimeSeriesDataset dataset) throws PredictionException
predict in class ASimplifiedTSClassifier<java.lang.Integer>dataset - The TimeSeriesDataset for which predictions should be
made.PredictionException - If something fails during the prediction processpublic int[][] getSegments()
public void setSegments(int[][] segments)
segments - the segments to setpublic int[][] getSegmentsDifference()
public void setSegmentsDifference(int[][] segmentsDifference)
segmentsDifference - the segmentsDifference to setpublic int[] getLengthPerTree()
public void setLengthPerTree(int[] lengthPerTree)
lengthPerTree - the lengthPerTree to setpublic int[] getClassAttIndexPerTree()
public void setClassAttIndexPerTree(int[] classAttIndexPerTree)
classAttIndexPerTree - the classAttIndexPerTree to setpublic AccessibleRandomTree[] getTrees()
public void setTrees(AccessibleRandomTree[] trees)
trees - the trees to setpublic int[][][] getTrainLeafNodes()
public void setTrainLeafNodes(int[][][] trainLeafNodes)
trainLeafNodes - the trainLeafNodes to setpublic int[] getTrainTargets()
public void setTrainTargets(int[] trainTargets)
trainTargets - the trainTargets to setpublic java.util.List<weka.core.Attribute> getAttributes()
public void setAttributes(java.util.List<weka.core.Attribute> attributes)
attributes - the attributes to setpublic LearnPatternSimilarityLearningAlgorithm getLearningAlgorithm(TimeSeriesDataset dataset)
getLearningAlgorithm in class ASimplifiedTSClassifier<java.lang.Integer>