public abstract class AbstractClassifier extends Object implements Classifier, Cloneable, Serializable, OptionHandler, CapabilitiesHandler, RevisionHandler
Constructor and Description |
---|
AbstractClassifier() |
Modifier and Type | Method and Description |
---|---|
double |
classifyInstance(Instance instance)
Classifies the given test instance.
|
String |
debugTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance instance)
Predicts the class memberships for a given instance.
|
static Classifier |
forName(String classifierName,
String[] options)
Creates a new instance of a classifier given it's class name and
(optional) arguments to pass to it's setOptions method.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this classifier.
|
boolean |
getDebug()
Get whether debugging is turned on.
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static Classifier[] |
makeCopies(Classifier model,
int num)
Creates a given number of deep copies of the given classifier using serialization.
|
static Classifier |
makeCopy(Classifier model)
Creates a deep copy of the given classifier using serialization.
|
static void |
runClassifier(Classifier classifier,
String[] options)
runs the classifier instance with the given options.
|
void |
setDebug(boolean debug)
Set debugging mode.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildClassifier
public double classifyInstance(Instance instance) throws Exception
classifyInstance
in interface Classifier
instance
- the instance to be classifiedException
- if an error occurred during the predictionpublic double[] distributionForInstance(Instance instance) throws Exception
distributionForInstance
in interface Classifier
instance
- the instance to be classifiedException
- if distribution could not be
computed successfullypublic static Classifier forName(String classifierName, String[] options) throws Exception
classifierName
- the fully qualified class name of the classifieroptions
- an array of options suitable for passing to setOptions. May
be null.Exception
- if the classifier name is invalid, or the options
supplied are not acceptable to the classifierpublic static Classifier makeCopy(Classifier model) throws Exception
model
- the classifier to copyException
- if an error occurspublic static Classifier[] makeCopies(Classifier model, int num) throws Exception
model
- the classifier to copynum
- the number of classifier copies to create.Exception
- if an error occurspublic Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-D
If set, classifier is run in debug mode and
may output additional info to the console.
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public void setDebug(boolean debug)
debug
- true if debug output should be printedpublic boolean getDebug()
public String debugTipText()
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
Capabilities
public String getRevision()
getRevision
in interface RevisionHandler
public static void runClassifier(Classifier classifier, String[] options)
classifier
- the classifier to runoptions
- the commandline optionsCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.