public abstract class AbstractClusterer extends java.lang.Object implements Clusterer, java.lang.Cloneable, java.io.Serializable, CapabilitiesHandler, RevisionHandler, OptionHandler, CapabilitiesIgnorer, CommandlineRunnable
| Constructor and Description |
|---|
AbstractClusterer() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
buildClusterer(Instances data)
Generates a clusterer.
|
int |
clusterInstance(Instance instance)
Classifies a given instance.
|
java.lang.String |
debugTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance instance)
Predicts the cluster memberships for a given instance.
|
java.lang.String |
doNotCheckCapabilitiesTipText()
Returns the tip text for this property
|
static Clusterer |
forName(java.lang.String clustererName,
java.lang.String[] options)
Creates a new instance of a clusterer given it's class name and (optional)
arguments to pass to it's setOptions method.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this clusterer.
|
boolean |
getDebug()
Get whether debugging is turned on.
|
boolean |
getDoNotCheckCapabilities()
Get whether capabilities checking is turned off.
|
java.lang.String[] |
getOptions()
Gets the current settings of the clusterer.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static Clusterer[] |
makeCopies(Clusterer model,
int num)
Creates copies of the current clusterer.
|
static Clusterer |
makeCopy(Clusterer model)
Creates a deep copy of the given clusterer using serialization.
|
abstract int |
numberOfClusters()
Returns the number of clusters.
|
void |
postExecution()
Perform any teardown stuff that might need to happen after execution.
|
void |
preExecution()
Perform any setup stuff that might need to happen before commandline
execution.
|
void |
run(java.lang.Object toRun,
java.lang.String[] options)
Execute the supplied object.
|
static void |
runClusterer(Clusterer clusterer,
java.lang.String[] options)
runs the clusterer instance with the given options.
|
void |
setDebug(boolean debug)
Set debugging mode.
|
void |
setDoNotCheckCapabilities(boolean doNotCheckCapabilities)
Set whether not to check capabilities.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmakeCopypublic abstract void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer in interface Clustererdata - set of instances serving as training datajava.lang.Exception - if the clusterer has not been generated successfullypublic int clusterInstance(Instance instance) throws java.lang.Exception
clusterInstance in interface Clustererinstance - the instance to be assigned to a clusterjava.lang.Exception - if instance could not be clustered successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance in interface Clustererinstance - the instance to be assigned a cluster.java.lang.Exception - if distribution could not be computed successfullypublic abstract int numberOfClusters()
throws java.lang.Exception
numberOfClusters in interface Clustererjava.lang.Exception - if number of clusters could not be returned
successfullypublic java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-D
If set, clusterer is run in debug mode and may output additional info to
the console.
-do-not-check-capabilities
If set, clusterer capabilities are not checked before clusterer is built
(use with caution).
setOptions in interface OptionHandleroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic void setDebug(boolean debug)
debug - true if debug output should be printedpublic boolean getDebug()
public java.lang.String debugTipText()
public void setDoNotCheckCapabilities(boolean doNotCheckCapabilities)
setDoNotCheckCapabilities in interface CapabilitiesIgnorerdoNotCheckCapabilities - true if capabilities are not to be checked.public boolean getDoNotCheckCapabilities()
getDoNotCheckCapabilities in interface CapabilitiesIgnorerpublic java.lang.String doNotCheckCapabilitiesTipText()
public java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic static Clusterer forName(java.lang.String clustererName, java.lang.String[] options) throws java.lang.Exception
clustererName - the fully qualified class name of the clustereroptions - an array of options suitable for passing to setOptions. May
be null.java.lang.Exception - if the clusterer class name is invalid, or the options
supplied are not acceptable to the clusterer.public static Clusterer makeCopy(Clusterer model) throws java.lang.Exception
model - the clusterer to copyjava.lang.Exception - if an error occurspublic static Clusterer[] makeCopies(Clusterer model, int num) throws java.lang.Exception
model - an example clusterer to copynum - the number of clusterer copies to create.java.lang.Exception - if an error occurspublic Capabilities getCapabilities()
getCapabilities in interface ClusterergetCapabilities in interface CapabilitiesHandlerCapabilitiespublic java.lang.String getRevision()
getRevision in interface RevisionHandlerpublic static void runClusterer(Clusterer clusterer, java.lang.String[] options)
clusterer - the clusterer to runoptions - the commandline optionspublic void preExecution()
throws java.lang.Exception
preExecution in interface CommandlineRunnablejava.lang.Exception - if a problem occurs during setuppublic void run(java.lang.Object toRun,
java.lang.String[] options)
throws java.lang.Exception
run in interface CommandlineRunnabletoRun - the object to executeoptions - any options to pass to the objectjava.lang.Exception - if the object if a problem occurspublic void postExecution()
throws java.lang.Exception
postExecution in interface CommandlineRunnablejava.lang.Exception - if a problem occurs during teardown