|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectweka.clusterers.Clusterer
weka.clusterers.DensityBasedClusterer
weka.clusterers.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.
| 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. |
double[] |
clusterPriors()
Returns the cluster priors. |
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.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.DensityBasedClusterer |
distributionForInstance, logDensityForInstance |
| Methods inherited from class weka.clusterers.Clusterer |
clusterInstance, forName, makeCopies |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MakeDensityBasedClusterer()
public MakeDensityBasedClusterer(Clusterer toWrap)
toWrap - the clusterer to wrap around| Method Detail |
public void setNumClusters(int n)
throws java.lang.Exception
setNumClusters in interface NumberOfClustersRequestablen - 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 void buildClusterer(Instances data)
throws java.lang.Exception
buildClusterer in class Clustererdata - set of instances serving as training data
java.lang.Exception - if the clusterer hasn't been set or something goes wrongpublic double[] clusterPriors()
clusterPriors in class DensityBasedClusterer
public double[] logDensityPerClusterForInstance(Instance inst)
throws java.lang.Exception
logDensityPerClusterForInstance in class DensityBasedClustererinst - the instance to compute the density for
java.lang.Exception - if the density could not be computed
successfully
public int numberOfClusters()
throws java.lang.Exception
numberOfClusters in class Clustererjava.lang.Exception - if number of clusters could not be returned successfullypublic java.lang.String toString()
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
-W clusterer name
Clusterer to wrap. (required)
-M
Set the minimum allowable standard deviation for normal density
calculation.
setOptions in interface OptionHandler
options - the list of options as an array of strings
java.lang.Exception - if an option is not supported
public java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic 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 | ||||||||||