public class MakeDensityBasedClusterer extends AbstractDensityBasedClusterer implements NumberOfClustersRequestable, OptionHandler, WeightedInstancesHandler
-M <num> minimum allowable standard deviation for normal density computation (default 1e-6)
-W <clusterer name> Clusterer to wrap. (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)Options after "--" are passed on to the base clusterer.
| Constructor and Description |
|---|
MakeDensityBasedClusterer()
Default constructor.
|
MakeDensityBasedClusterer(Clusterer toWrap)
Contructs a MakeDensityBasedClusterer wrapping a given Clusterer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildClusterer(Instances data)
Builds a clusterer for a set of instances.
|
java.lang.String |
clustererTipText()
Returns the tip text for this property
|
double[] |
clusterPriors()
Returns the cluster priors.
|
Capabilities |
getCapabilities()
Returns default capabilities of the clusterer (i.e., of the wrapper
clusterer).
|
Clusterer |
getClusterer()
Gets the clusterer being wrapped.
|
double |
getMinStdDev()
Get the minimum allowable standard deviation.
|
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 classifier
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options..
|
double[] |
logDensityPerClusterForInstance(Instance inst)
Computes the log of the conditional density (per cluster) for a given
instance.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
minStdDevTipText()
Returns the tip text for this property
|
int |
numberOfClusters()
Returns the number of clusters.
|
void |
setClusterer(Clusterer toWrap)
Sets the clusterer to wrap.
|
void |
setMinStdDev(double m)
Set the minimum value for standard deviation when calculating normal
density.
|
void |
setNumClusters(int n)
Set the number of clusters to generate.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Returns a description of the clusterer.
|
distributionForInstance, logDensityForInstance, logJointDensitiesForInstance, makeCopiesclusterInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, postExecution, preExecution, run, runClusterer, setDebug, setDoNotCheckCapabilitiesequals, getClass, hashCode, notify, notifyAll, wait, wait, waitclusterInstancepublic MakeDensityBasedClusterer()
public MakeDensityBasedClusterer(Clusterer toWrap)
toWrap - the clusterer to wrap aroundpublic java.lang.String globalInfo()
public void setNumClusters(int n)
throws java.lang.Exception
setNumClusters in interface NumberOfClustersRequestablen - the number of clusters to generatejava.lang.Exception - if the wrapped clusterer has not been set, or if the
wrapped clusterer does not implement this facility.public Capabilities getCapabilities()
getCapabilities in interface ClusterergetCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractClustererCapabilitiespublic void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer in interface ClustererbuildClusterer in class AbstractClustererdata - the instances to train the clusterer withjava.lang.Exception - if the clusterer hasn't been set or something goes wrongpublic double[] clusterPriors()
clusterPriors in interface DensityBasedClustererclusterPriors in class AbstractDensityBasedClustererpublic double[] logDensityPerClusterForInstance(Instance inst) throws java.lang.Exception
logDensityPerClusterForInstance in interface DensityBasedClustererlogDensityPerClusterForInstance in class AbstractDensityBasedClustererinst - the instance to compute the density forjava.lang.Exception - if the density could not be computed successfullypublic int numberOfClusters()
throws java.lang.Exception
numberOfClusters in interface ClusterernumberOfClusters in class AbstractClustererjava.lang.Exception - if number of clusters could not be returned successfullypublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String clustererTipText()
public void setClusterer(Clusterer toWrap)
toWrap - the clustererpublic Clusterer getClusterer()
public java.lang.String minStdDevTipText()
public void setMinStdDev(double m)
m - minimum value for standard deviationpublic double getMinStdDev()
public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class AbstractClustererpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-M <num> minimum allowable standard deviation for normal density computation (default 1e-6)
-W <clusterer name> Clusterer to wrap. (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 OptionHandlersetOptions in class AbstractClustereroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class AbstractClustererpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClustererpublic static void main(java.lang.String[] argv)
argv - the options