|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.clusterers.Clusterer | +--weka.clusterers.DistributionClusterer | +--weka.clusterers.DistributionMetaClusterer
Class that wraps up a Clusterer and presents it as a DistributionClusterer for ease of programmatically handling Clusterers in general -- only the one predict method (distributionForInstance) need be worried about. The distributions produced by this clusterer place a probability of 1 on the class value predicted by the sub-clusterer.
Valid options are:
-W classname
Specify the full class name of a sub-clusterer (required).
Constructor Summary | |
DistributionMetaClusterer()
|
Method Summary | |
void |
buildClusterer(Instances insts)
Builds the clusterer. |
double |
densityForInstance(Instance inst)
Returns the density for an instance. |
double[] |
distributionForInstance(Instance inst)
Returns the distribution for an instance. |
Clusterer |
getClusterer()
Get the clusterer used as the clusterer |
java.lang.String[] |
getOptions()
Gets the current settings of the Clusterer. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
int |
numberOfClusters()
Returns the number of clusters. |
void |
setClusterer(Clusterer newClusterer)
Set the base clusterer. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Prints the clusterers. |
Methods inherited from class weka.clusterers.DistributionClusterer |
clusterInstance |
Methods inherited from class weka.clusterers.Clusterer |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DistributionMetaClusterer()
Method Detail |
public void buildClusterer(Instances insts) throws java.lang.Exception
buildClusterer
in class Clusterer
insts
- the training data.java.lang.Exception
- if a clusterer can't be builtpublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
distributionForInstance
in class DistributionClusterer
java.lang.Exception
- if the distribution can't be computed successfullypublic double densityForInstance(Instance inst) throws java.lang.Exception
densityForInstance
in class DistributionClusterer
java.lang.Exception
- if the distribution can't be computed successfullypublic int numberOfClusters() throws java.lang.Exception
numberOfClusters
in class Clusterer
java.lang.Exception
- if number of clusters could not be returned
successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-W classname
Specify the full class name of a learner as the basis for
the multiclassclusterer (required).
setOptions
in interface OptionHandler
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
public void setClusterer(Clusterer newClusterer)
newClusterer
- the Clusterer to use.public Clusterer getClusterer()
public static void main(java.lang.String[] argv)
argv
- the options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |