Package moa.clusterers
Class AbstractClusterer
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.clusterers.AbstractClusterer
-
- All Implemented Interfaces:
Configurable
,Serializable
,Clusterer
,AWTRenderable
,MOAObject
,OptionHandler
- Direct Known Subclasses:
BICO
,ClusterGenerator
,Clustream
,ClusTree
,CobWeb
,Dstream
,EnsembleClustererAbstract
,MyBaseOutlierDetector
,StreamKM
,WekaClusteringAlgorithm
,WithDBSCAN
,WithKmeans
public abstract class AbstractClusterer extends AbstractOptionHandler implements Clusterer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Random
clustererRandom
protected Clustering
clustering
FlagOption
evaluateMicroClusteringOption
protected InstancesHeader
modelContext
protected int
randomSeed
protected IntOption
randomSeedOption
protected double
trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description AbstractClusterer()
-
Method Summary
-
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.clusterers.Clusterer
getClusteringResult, getVotesForInstance, isRandomizable
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
modelContext
protected InstancesHeader modelContext
-
trainingWeightSeenByModel
protected double trainingWeightSeenByModel
-
randomSeed
protected int randomSeed
-
randomSeedOption
protected IntOption randomSeedOption
-
evaluateMicroClusteringOption
public FlagOption evaluateMicroClusteringOption
-
clustererRandom
protected Random clustererRandom
-
clustering
protected Clustering clustering
-
-
Method Detail
-
getPurposeString
public String getPurposeString()
Description copied from class:AbstractOptionHandler
Dictionary with option texts and objects- Specified by:
getPurposeString
in interfaceOptionHandler
- Overrides:
getPurposeString
in classAbstractOptionHandler
- Returns:
- the string with the purpose of this object
-
prepareForUseImpl
public void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
Description copied from class:AbstractOptionHandler
This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implementprepareForUseImpl
and notprepareForUse
sinceprepareForUse
callsprepareForUseImpl
.- Specified by:
prepareForUseImpl
in classAbstractOptionHandler
- Parameters:
monitor
- the TaskMonitor to userepository
- the ObjectRepository to use
-
setModelContext
public void setModelContext(InstancesHeader ih)
- Specified by:
setModelContext
in interfaceClusterer
-
getModelContext
public InstancesHeader getModelContext()
- Specified by:
getModelContext
in interfaceClusterer
-
setRandomSeed
public void setRandomSeed(int s)
- Specified by:
setRandomSeed
in interfaceClusterer
-
trainingHasStarted
public boolean trainingHasStarted()
- Specified by:
trainingHasStarted
in interfaceClusterer
-
trainingWeightSeenByModel
public double trainingWeightSeenByModel()
- Specified by:
trainingWeightSeenByModel
in interfaceClusterer
-
resetLearning
public void resetLearning()
- Specified by:
resetLearning
in interfaceClusterer
-
trainOnInstance
public void trainOnInstance(Instance inst)
- Specified by:
trainOnInstance
in interfaceClusterer
-
getModelMeasurements
public Measurement[] getModelMeasurements()
- Specified by:
getModelMeasurements
in interfaceClusterer
-
getDescription
public void getDescription(StringBuilder out, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Parameters:
out
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
getSubClusterers
public Clusterer[] getSubClusterers()
- Specified by:
getSubClusterers
in interfaceClusterer
-
copy
public Clusterer copy()
Description copied from interface:MOAObject
This method produces a copy of this object.- Specified by:
copy
in interfaceClusterer
- Specified by:
copy
in interfaceMOAObject
- Specified by:
copy
in interfaceOptionHandler
- Overrides:
copy
in classAbstractOptionHandler
- Returns:
- a copy of this object
-
getClassNameString
public String getClassNameString()
-
getClassLabelString
public String getClassLabelString(int classLabelIndex)
-
getAttributeNameString
public String getAttributeNameString(int attIndex)
-
getNominalValueString
public String getNominalValueString(int attIndex, int valIndex)
-
contextIsCompatible
public static boolean contextIsCompatible(InstancesHeader originalContext, InstancesHeader newContext)
-
getAWTRenderer
public AWTRenderer getAWTRenderer()
- Specified by:
getAWTRenderer
in interfaceAWTRenderable
-
resetLearningImpl
public abstract void resetLearningImpl()
-
trainOnInstanceImpl
public abstract void trainOnInstanceImpl(Instance inst)
-
getModelMeasurementsImpl
protected abstract Measurement[] getModelMeasurementsImpl()
-
getModelDescription
public abstract void getModelDescription(StringBuilder out, int indent)
-
modelAttIndexToInstanceAttIndex
protected static int modelAttIndexToInstanceAttIndex(int index, Instance inst)
-
modelAttIndexToInstanceAttIndex
protected static int modelAttIndexToInstanceAttIndex(int index, Instances insts)
-
implementsMicroClusterer
public boolean implementsMicroClusterer()
- Specified by:
implementsMicroClusterer
in interfaceClusterer
-
keepClassLabel
public boolean keepClassLabel()
- Specified by:
keepClassLabel
in interfaceClusterer
-
getMicroClusteringResult
public Clustering getMicroClusteringResult()
- Specified by:
getMicroClusteringResult
in interfaceClusterer
-
adjustParameters
public void adjustParameters()
-
-