public class FilteredClusterer extends SingleClustererEnhancer implements Drawable
-F <filter specification> Full class name of filter to use, followed by filter options. eg: "weka.filters.unsupervised.attribute.Remove -V -R 1,2" (default: weka.filters.AllFilter)
-W Full name of base clusterer. (default: weka.clusterers.SimpleKMeans)
Options specific to clusterer weka.clusterers.SimpleKMeans:
-N <num> number of clusters. (default 2).
-V Display std. deviations for centroids.
-M Replace missing values with mean/mode.
-S <num> Random number seed. (default 10)Based on code from the FilteredClassifier by Len Trigg.
FilteredClassifier
,
Serialized FormBayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
FilteredClusterer()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildClusterer(Instances data)
Build the clusterer on the filtered data.
|
double[] |
distributionForInstance(Instance instance)
Classifies a given instance after filtering.
|
java.lang.String |
filterTipText()
Returns the tip text for this property.
|
Capabilities |
getCapabilities()
Returns default capabilities of the clusterer.
|
Filter |
getFilter()
Gets the filter used.
|
java.lang.String[] |
getOptions()
Gets the current settings of the clusterer.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing this clusterer.
|
java.lang.String |
graph()
Returns graph describing the clusterer (if possible).
|
int |
graphType()
Returns the type of graph this clusterer represents.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
void |
setFilter(Filter filter)
Sets the filter.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Output a representation of this clusterer.
|
clustererTipText, getClusterer, numberOfClusters, setClusterer
clusterInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, postExecution, preExecution, run, runClusterer, setDebug, setDoNotCheckCapabilities
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class SingleClustererEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-F <filter specification> Full class name of filter to use, followed by filter options. eg: "weka.filters.unsupervised.attribute.Remove -V -R 1,2" (default: weka.filters.AllFilter)
-W Full name of base clusterer. (default: weka.clusterers.SimpleKMeans)
Options specific to clusterer weka.clusterers.SimpleKMeans:
-N <num> number of clusters. (default 2).
-V Display std. deviations for centroids.
-M Replace missing values with mean/mode.
-S <num> Random number seed. (default 10)
setOptions
in interface OptionHandler
setOptions
in class SingleClustererEnhancer
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SingleClustererEnhancer
public java.lang.String filterTipText()
public void setFilter(Filter filter)
filter
- the filter with all options set.public Filter getFilter()
public Capabilities getCapabilities()
getCapabilities
in interface Clusterer
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class SingleClustererEnhancer
Capabilities
public void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer
in interface Clusterer
buildClusterer
in class AbstractClusterer
data
- the training datajava.lang.Exception
- if the clusterer could not be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in interface Clusterer
distributionForInstance
in class AbstractClusterer
instance
- the instance to be classifiedjava.lang.Exception
- if instance could not be classified successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public int graphType()
public java.lang.String graph() throws java.lang.Exception
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer
public static void main(java.lang.String[] args)
args
- the commandline options, use "-h" for help