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, makeCopies
clusterInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, postExecution, preExecution, run, runClusterer, setDebug, setDoNotCheckCapabilities
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
clusterInstance
public 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 NumberOfClustersRequestable
n
- 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 Clusterer
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClusterer
Capabilities
public void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer
in interface Clusterer
buildClusterer
in class AbstractClusterer
data
- 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 DensityBasedClusterer
clusterPriors
in class AbstractDensityBasedClusterer
public double[] logDensityPerClusterForInstance(Instance inst) throws java.lang.Exception
logDensityPerClusterForInstance
in interface DensityBasedClusterer
logDensityPerClusterForInstance
in class AbstractDensityBasedClusterer
inst
- 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 Clusterer
numberOfClusters
in class AbstractClusterer
java.lang.Exception
- if number of clusters could not be returned successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public 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 OptionHandler
listOptions
in class AbstractClusterer
public 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 OptionHandler
setOptions
in class AbstractClusterer
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 AbstractClusterer
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer
public static void main(java.lang.String[] argv)
argv
- the options