|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.clusterers.AbstractClusterer
weka.clusterers.AbstractDensityBasedClusterer
weka.clusterers.MakeDensityBasedClusterer
public class MakeDensityBasedClusterer
Class for wrapping a Clusterer to make it return a distribution and density. Fits normal distributions and discrete distributions within each cluster produced by the wrapped clusterer. Supports the NumberOfClustersRequestable interface only if the wrapped Clusterer does.
Valid options are:-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 Summary | |
---|---|
MakeDensityBasedClusterer()
Default constructor. |
|
MakeDensityBasedClusterer(Clusterer toWrap)
Contructs a MakeDensityBasedClusterer wrapping a given Clusterer. |
Method Summary | |
---|---|
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 |
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. |
Methods inherited from class weka.clusterers.AbstractDensityBasedClusterer |
---|
distributionForInstance, logDensityForInstance, logJointDensitiesForInstance, makeCopies |
Methods inherited from class weka.clusterers.AbstractClusterer |
---|
clusterInstance, forName, makeCopies, makeCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface weka.clusterers.Clusterer |
---|
clusterInstance |
Constructor Detail |
---|
public MakeDensityBasedClusterer()
public MakeDensityBasedClusterer(Clusterer toWrap)
toWrap
- the clusterer to wrap aroundMethod Detail |
---|
public java.lang.String globalInfo()
public void setNumClusters(int n) throws java.lang.Exception
setNumClusters
in interface NumberOfClustersRequestable
n
- the number of clusters to generate
java.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 with
java.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 for
java.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 listOptions()
listOptions
in interface OptionHandler
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
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer
public static void main(java.lang.String[] argv)
argv
- the options
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |