Package weka.clusterers
Class Cobweb
java.lang.Object
weka.clusterers.AbstractClusterer
weka.clusterers.RandomizableClusterer
weka.clusterers.Cobweb
- All Implemented Interfaces:
Serializable,Cloneable,Clusterer,UpdateableClusterer,CapabilitiesHandler,CapabilitiesIgnorer,CommandlineRunnable,Drawable,OptionHandler,Randomizable,RevisionHandler,TechnicalInformationHandler
public class Cobweb
extends RandomizableClusterer
implements Drawable, TechnicalInformationHandler, UpdateableClusterer
Class implementing the Cobweb and Classit clustering algorithms.
Note: the application of node operators (merging, splitting etc.) in terms of ordering and priority differs (and is somewhat ambiguous) between the original Cobweb and Classit papers. This algorithm always compares the best host, adding a new leaf, merging the two best hosts, and splitting the best host when considering where to place a new instance.
For more information see:
D. Fisher (1987). Knowledge acquisition via incremental conceptual clustering. Machine Learning. 2(2):139-172.
J. H. Gennari, P. Langley, D. Fisher (1990). Models of incremental concept formation. Artificial Intelligence. 40:11-61. BibTeX:
Note: the application of node operators (merging, splitting etc.) in terms of ordering and priority differs (and is somewhat ambiguous) between the original Cobweb and Classit papers. This algorithm always compares the best host, adding a new leaf, merging the two best hosts, and splitting the best host when considering where to place a new instance.
For more information see:
D. Fisher (1987). Knowledge acquisition via incremental conceptual clustering. Machine Learning. 2(2):139-172.
J. H. Gennari, P. Langley, D. Fisher (1990). Models of incremental concept formation. Artificial Intelligence. 40:11-61. BibTeX:
@article{Fisher1987,
author = {D. Fisher},
journal = {Machine Learning},
number = {2},
pages = {139-172},
title = {Knowledge acquisition via incremental conceptual clustering},
volume = {2},
year = {1987}
}
@article{Gennari1990,
author = {J. H. Gennari and P. Langley and D. Fisher},
journal = {Artificial Intelligence},
pages = {11-61},
title = {Models of incremental concept formation},
volume = {40},
year = {1990}
}
Valid options are:
-A <acuity> Acuity. (default=1.0)
-C <cutoff> Cutoff. (default=0.002)
-save-data Save instance data.
-S <num> Random number seed. (default 42)
-output-debug-info If set, clusterer is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, clusterer capabilities are not checked before clusterer is built (use with caution).
- Version:
- $Revision: 15520 $
- Author:
- Mark Hall
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInner class handling node operations for Cobweb. -
Field Summary
Fields inherited from interface weka.core.Drawable
BayesNet, Newick, NOT_DRAWABLE, TREE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the tip text for this propertyvoidaddInstance(Instance newInstance) Deprecated.updateClusterer(Instance) should be used insteadvoidbuildClusterer(Instances data) Builds the clusterer.intclusterInstance(Instance instance) Classifies a given instance.Returns the tip text for this propertydoubleget the acuity valueReturns default capabilities of the clusterer.doubleget the cutoffString[]Gets the current settings of Cobweb.Returns the revision string.booleanGet the value of saveInstances.Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.Get the root of the tree.Returns a string describing this clusterergraph()Generates the graph string of the Cobweb treeintReturns the type of graphs this class representsReturns an enumeration describing the available options.static voidMain method.intReturns the number of clusters.Returns the tip text for this propertyReturns the tip text for this propertyvoidsetAcuity(double a) set the acuity.voidsetCutoff(double c) set the cutoffvoidsetOptions(String[] options) Parses a given list of options.voidsetSaveInstanceData(boolean newsaveInstances) Set the value of saveInstances.toString()Returns a description of the clusterer as a string.voidupdateClusterer(Instance newInstance) Adds an instance to the clusterer.voidSingals the end of the updating.Methods inherited from class weka.clusterers.RandomizableClusterer
getSeed, setSeedMethods inherited from class weka.clusterers.AbstractClusterer
debugTipText, distributionForInstance, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, postExecution, preExecution, run, runClusterer, setDebug, setDoNotCheckCapabilities
-
Constructor Details
-
Cobweb
public Cobweb()default constructor
-
-
Method Details
-
globalInfo
Returns a string describing this clusterer- Returns:
- a description of the evaluator suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
getCapabilities
Returns default capabilities of the clusterer.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Specified by:
getCapabilitiesin interfaceClusterer- Overrides:
getCapabilitiesin classAbstractClusterer- Returns:
- the capabilities of this clusterer
- See Also:
-
buildClusterer
Builds the clusterer.- Specified by:
buildClustererin interfaceClusterer- Specified by:
buildClustererin classAbstractClusterer- Parameters:
data- the training instances.- Throws:
Exception- if something goes wrong.
-
updateFinished
public void updateFinished()Singals the end of the updating.- Specified by:
updateFinishedin interfaceUpdateableClusterer
-
clusterInstance
Classifies a given instance.- Specified by:
clusterInstancein interfaceClusterer- Overrides:
clusterInstancein classAbstractClusterer- Parameters:
instance- the instance to be assigned to a cluster- Returns:
- the number of the assigned cluster as an interger if the class is enumerated, otherwise the predicted value
- Throws:
Exception- if instance could not be classified successfully
-
numberOfClusters
public int numberOfClusters()Returns the number of clusters.- Specified by:
numberOfClustersin interfaceClusterer- Specified by:
numberOfClustersin classAbstractClusterer- Returns:
- the number of clusters
-
getTreeRoot
Get the root of the tree.- Returns:
- the root of the tree.
-
updateClusterer
Adds an instance to the clusterer.- Specified by:
updateClustererin interfaceUpdateableClusterer- Parameters:
newInstance- the instance to be added- Throws:
Exception- if something goes wrong
-
addInstance
Deprecated.updateClusterer(Instance) should be used insteadAdds an instance to the Cobweb tree.- Parameters:
newInstance- the instance to be added- Throws:
Exception- if something goes wrong- See Also:
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classRandomizableClusterer- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-A <acuity> Acuity. (default=1.0)
-C <cutoff> Cutoff. (default=0.002)
-save-data Save instance data.
-S <num> Random number seed. (default 42)
-output-debug-info If set, clusterer is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, clusterer capabilities are not checked before clusterer is built (use with caution).
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classRandomizableClusterer- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
acuityTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setAcuity
public void setAcuity(double a) set the acuity.- Parameters:
a- the acuity value
-
getAcuity
public double getAcuity()get the acuity value- Returns:
- the acuity
-
cutoffTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setCutoff
public void setCutoff(double c) set the cutoff- Parameters:
c- the cutof
-
getCutoff
public double getCutoff()get the cutoff- Returns:
- the cutoff
-
saveInstanceDataTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getSaveInstanceData
public boolean getSaveInstanceData()Get the value of saveInstances.- Returns:
- Value of saveInstances.
-
setSaveInstanceData
public void setSaveInstanceData(boolean newsaveInstances) Set the value of saveInstances.- Parameters:
newsaveInstances- Value to assign to saveInstances.
-
getOptions
Gets the current settings of Cobweb.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classRandomizableClusterer- Returns:
- an array of strings suitable for passing to setOptions()
-
toString
Returns a description of the clusterer as a string. -
graphType
public int graphType()Returns the type of graphs this class represents -
graph
Generates the graph string of the Cobweb tree -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classAbstractClusterer- Returns:
- the revision
-
seedTipText
Returns the tip text for this property- Overrides:
seedTipTextin classRandomizableClusterer- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
main
Main method.- Parameters:
argv- the commandline options
-