Package moa.clusterers.kmeanspm
Class BICO
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.clusterers.AbstractClusterer
-
- moa.clusterers.kmeanspm.BICO
-
- All Implemented Interfaces:
Configurable
,Serializable
,Clusterer
,AWTRenderable
,MOAObject
,OptionHandler
public class BICO extends AbstractClusterer
A instance of this class provides the BICO clustering algorithm. Citation: Hendrik Fichtenberger, Marc Gillé, Melanie Schmidt, Chris Schwiegelshohn, Christian Sohler: BICO: BIRCH Meets Coresets for k-Means Clustering. ESA 2013: 481-492 (2013) http://ls2-www.cs.tu-dortmund.de/bico/- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
maxNumClusterFeatures
IntOption
maxNumClusterFeaturesOption
protected int
numClusters
IntOption
numClustersOption
protected int
numDimensions
IntOption
numDimensionsOption
protected int
numProjections
IntOption
numProjectionsOption
-
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 BICO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bicoCFUpdate(ClusteringTreeNode x)
Inserts a ClusteringTreeNode into the ClusteringFeature tree.protected void
bicoUpdate(double[] x)
Inserts a new point into the ClusteringFeature tree.protected double
calcR(int level)
Calculates the threshold at a specific level in the ClusteringFeature tree.protected double
calcRSquared(int level)
Calculates the squared threshold at a specific level in the ClusteringFeature tree.Clustering
getClusteringResult()
Clustering
getMicroClusteringResult()
int
getMicroClusteringSize()
Returns the current size of the micro clustering.void
getModelDescription(StringBuilder out, int indent)
protected Measurement[]
getModelMeasurementsImpl()
double[]
getVotesForInstance(Instance inst)
boolean
implementsMicroClusterer()
boolean
isRandomizable()
void
printMicroClusteringResult(Writer stream)
Writes all micro cluster to a given stream.protected void
rebuild()
If the number of ClusteringTreeNodes exceeds the maximum bound, the global threshold T will be doubled and the tree will be rebuild with the new threshold.void
resetLearningImpl()
void
trainOnInstanceImpl(Instance inst)
-
Methods inherited from class moa.clusterers.AbstractClusterer
adjustParameters, 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
-
numClustersOption
public IntOption numClustersOption
-
numDimensionsOption
public IntOption numDimensionsOption
-
maxNumClusterFeaturesOption
public IntOption maxNumClusterFeaturesOption
-
numProjectionsOption
public IntOption numProjectionsOption
-
numClusters
protected int numClusters
-
numDimensions
protected int numDimensions
-
maxNumClusterFeatures
protected int maxNumClusterFeatures
-
numProjections
protected int numProjections
-
-
Method Detail
-
isRandomizable
public boolean isRandomizable()
-
implementsMicroClusterer
public boolean implementsMicroClusterer()
- Specified by:
implementsMicroClusterer
in interfaceClusterer
- Overrides:
implementsMicroClusterer
in classAbstractClusterer
-
getMicroClusteringResult
public Clustering getMicroClusteringResult()
- Specified by:
getMicroClusteringResult
in interfaceClusterer
- Overrides:
getMicroClusteringResult
in classAbstractClusterer
-
printMicroClusteringResult
public void printMicroClusteringResult(Writer stream) throws IOException
Writes all micro cluster to a given stream.- Parameters:
stream
- the stream- Throws:
IOException
- If an I/O error occurs
-
getMicroClusteringSize
public int getMicroClusteringSize()
Returns the current size of the micro clustering.- Returns:
- The size of the micro clustering
-
getVotesForInstance
public double[] getVotesForInstance(Instance inst)
-
getClusteringResult
public Clustering getClusteringResult()
-
resetLearningImpl
public void resetLearningImpl()
- Specified by:
resetLearningImpl
in classAbstractClusterer
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance inst)
- Specified by:
trainOnInstanceImpl
in classAbstractClusterer
-
bicoUpdate
protected void bicoUpdate(double[] x)
Inserts a new point into the ClusteringFeature tree.- Parameters:
x
- the point
-
rebuild
protected void rebuild()
If the number of ClusteringTreeNodes exceeds the maximum bound, the global threshold T will be doubled and the tree will be rebuild with the new threshold.
-
bicoCFUpdate
protected void bicoCFUpdate(ClusteringTreeNode x)
Inserts a ClusteringTreeNode into the ClusteringFeature tree.- Parameters:
x
- the ClusteringTreeNode
-
calcRSquared
protected double calcRSquared(int level)
Calculates the squared threshold at a specific level in the ClusteringFeature tree.- Parameters:
level
- level in the tree- Returns:
- the squared threshold
-
calcR
protected double calcR(int level)
Calculates the threshold at a specific level in the ClusteringFeature tree.- Parameters:
level
- level in the tree- Returns:
- the threshold
-
getModelMeasurementsImpl
protected Measurement[] getModelMeasurementsImpl()
- Specified by:
getModelMeasurementsImpl
in classAbstractClusterer
-
getModelDescription
public void getModelDescription(StringBuilder out, int indent)
- Specified by:
getModelDescription
in classAbstractClusterer
-
-