|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.clusterers.Clusterer
weka.clusterers.DistributionClusterer
weka.clusterers.DistributionMetaClusterer
Class for wrapping a Clusterer to make it return a distribution. Simply outputs a probabiltry of 1 for the chosen cluster and 0 for the others.
Constructor Summary | |
DistributionMetaClusterer()
Default constructor. |
|
DistributionMetaClusterer(Clusterer toWrap)
Contructs a DistributionMetaClusterer wrapping a given Clusterer. |
Method Summary | |
void |
buildClusterer(Instances data)
Builds a clusterer for a set of instances. |
double |
densityForInstance(Instance instance)
Computes the density for a given instance. |
double[] |
distributionForInstance(Instance instance)
Returns the cluster probability distribution for an instance. |
Clusterer |
getClusterer()
Gets the clusterer being wrapped. |
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 toWrap)
Sets the clusterer to wrap. |
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.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()
public DistributionMetaClusterer(Clusterer toWrap)
toWrap
- the clusterer to wrap aroundMethod Detail |
public void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer
in class Clusterer
data
- set of instances serving as training data
java.lang.Exception
- if the clusterer hasn't been set or something goes wrongpublic double densityForInstance(Instance instance) throws java.lang.Exception
densityForInstance
in class DistributionClusterer
instance
- the instance to compute the density for
java.lang.Exception
- if the density could not be computed successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class DistributionClusterer
instance
- the instance to be clustered
java.lang.Exception
- if distribution could not 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()
public void setClusterer(Clusterer toWrap)
toWrap
- the clustererpublic Clusterer getClusterer()
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)
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 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 |