Package moa.clusterers.clustree
Class ClusTree
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.clusterers.AbstractClusterer
-
- moa.clusterers.clustree.ClusTree
-
- All Implemented Interfaces:
Configurable
,Serializable
,Clusterer
,AWTRenderable
,MOAObject
,OptionHandler
- Direct Known Subclasses:
AnyOutCore
public class ClusTree extends AbstractClusterer
Citation: ClusTree: Philipp Kranen, Ira Assent, Corinna Baldauf, Thomas Seidl: The ClusTree: indexing micro-clusters for anytime stream mining. Knowl. Inf. Syst. 29(2): 249-272 (2011)- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
breadthFirstStrat
Parameter to determine wich strategy to useFlagOption
breadthFirstStrategyOption
IntOption
horizonOption
protected int
maxHeight
The maximal height of the tree.IntOption
maxHeightOption
protected double
negLambda
Parameter for the weighting function use to weight the entries.protected Node
root
The root node of the tree.-
Fields inherited from class moa.clusterers.AbstractClusterer
clustererRandom, clustering, evaluateMicroClusteringOption, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description ClusTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adjustParameters()
Clustering
getClustering(long currentTime, int targetLevel)
Clustering
getClusteringResult()
protected int
getDefaultHeight()
int
getHeight()
Return the current height of the tree.Clustering
getMicroClusteringResult()
void
getModelDescription(StringBuilder out, int indent)
protected Measurement[]
getModelMeasurementsImpl()
int
getNumRootSplits()
Return the number of time the tree has grown in size.double[]
getVotesForInstance(Instance inst)
boolean
implementsMicroClusterer()
void
insert(ClusKernel newPoint, Budget budget, long timestamp)
Insert a new point in theTree
.boolean
isRandomizable()
void
resetLearningImpl()
void
trainOnInstanceImpl(Instance instance)
-
Methods inherited from class moa.clusterers.AbstractClusterer
contextIsCompatible, copy, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModelContext, getModelMeasurements, getNominalValueString, getPurposeString, getSubClusterers, keepClassLabel, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance
-
Methods inherited from class moa.options.AbstractOptionHandler
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
horizonOption
public IntOption horizonOption
-
maxHeightOption
public IntOption maxHeightOption
-
breadthFirstStrategyOption
public FlagOption breadthFirstStrategyOption
-
root
protected Node root
The root node of the tree.
-
negLambda
protected double negLambda
Parameter for the weighting function use to weight the entries.
-
maxHeight
protected int maxHeight
The maximal height of the tree.
-
breadthFirstStrat
protected boolean breadthFirstStrat
Parameter to determine wich strategy to use
-
-
Method Detail
-
getDefaultHeight
protected int getDefaultHeight()
-
resetLearningImpl
public void resetLearningImpl()
- Specified by:
resetLearningImpl
in classAbstractClusterer
-
getModelMeasurementsImpl
protected Measurement[] getModelMeasurementsImpl()
- Specified by:
getModelMeasurementsImpl
in classAbstractClusterer
-
isRandomizable
public boolean isRandomizable()
-
getModelDescription
public void getModelDescription(StringBuilder out, int indent)
- Specified by:
getModelDescription
in classAbstractClusterer
-
getVotesForInstance
public double[] getVotesForInstance(Instance inst)
-
implementsMicroClusterer
public boolean implementsMicroClusterer()
- Specified by:
implementsMicroClusterer
in interfaceClusterer
- Overrides:
implementsMicroClusterer
in classAbstractClusterer
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance instance)
- Specified by:
trainOnInstanceImpl
in classAbstractClusterer
-
insert
public void insert(ClusKernel newPoint, Budget budget, long timestamp)
Insert a new point in theTree
. The point should be represented as a cluster with a single data point(i.e. N = 1). ABudget
class is also given, which is informed of the number of operation the tree does, and informs the tree when it does not have time left and should stop the insertion.- Parameters:
newPoint
- The point to be inserted.budget
- The budget and statistics recollector for the insertion.timestamp
- The moment at which this point is inserted.- See Also:
ClusKernel
,Budget
-
getNumRootSplits
public int getNumRootSplits()
Return the number of time the tree has grown in size. If the tree grows and is then cutted from a certain depth, it also counts.- Returns:
- The number of times the root node was splitted.
-
getHeight
public int getHeight()
Return the current height of the tree. This should never be greater thanmaxHeight
.- Returns:
- The height of the tree.
- See Also:
maxHeight
-
getMicroClusteringResult
public Clustering getMicroClusteringResult()
- Specified by:
getMicroClusteringResult
in interfaceClusterer
- Overrides:
getMicroClusteringResult
in classAbstractClusterer
- Returns:
- The kernels at the leaf level as a clustering
-
getClusteringResult
public Clustering getClusteringResult()
-
getClustering
public Clustering getClustering(long currentTime, int targetLevel)
- Parameters:
currentTime
- The current time- Returns:
- The kernels at the given level as a clustering.
-
adjustParameters
public void adjustParameters()
- Overrides:
adjustParameters
in classAbstractClusterer
-
-