All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.Classifier
java.lang.Object
|
+----weka.classifiers.Classifier
- public abstract class Classifier
- extends Object
- implements Cloneable, Serializable
Abstract classifier. All schemes for numeric or nominal prediction in
Weka extend this class.
- Version:
- $Revision: 1.4 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz)
-
Classifier()
-
-
buildClassifier(Instances)
- Generates a classifier.
-
classifyInstance(Instance)
- Classifies a given instance.
-
forName(String, String[])
- Creates a new instance of a classifier given it's class name and
(optional) arguments to pass to it's setOptions method.
-
makeCopies(Classifier, int)
- Creates copies of the current classifier, which can then
be used for boosting etc.
Classifier
public Classifier()
buildClassifier
public abstract void buildClassifier(Instances data) throws Exception
- Generates a classifier. Must initialize all fields of the classifier
that are not being set via options (ie. multiple calls of buildClassifier
must always lead to the same result). Must not change the dataset
in any way.
- Parameters:
- data - set of instances serving as training data
- Throws: Exception
- if the classifier has not been
generated successfully
classifyInstance
public abstract double classifyInstance(Instance instance) throws Exception
- Classifies a given instance.
- Parameters:
- instance - the instance to be classified
- Returns:
- index of the predicted class as a double
if the class is nominal, otherwise the predicted value
- Throws: Exception
- if instance could not be classified
successfully
forName
public static Classifier forName(String classifierName,
String options[]) throws Exception
- Creates a new instance of a classifier given it's class name and
(optional) arguments to pass to it's setOptions method. If the
classifier implements OptionHandler and the options parameter is
non-null, the classifier will have it's options set.
- Parameters:
- classifierName - the fully qualified class name of the classifier
- options - an array of options suitable for passing to setOptions. May
be null.
- Returns:
- the newly created classifier, ready for use.
- Throws: Exception
- if the classifier name is invalid, or the options
supplied are not acceptable to the classifier
makeCopies
public static Classifier[] makeCopies(Classifier model,
int num) throws Exception
- Creates copies of the current classifier, which can then
be used for boosting etc.
- Parameters:
- model - an example classifier to copy
- num - the number of classifiers copies to create.
- Returns:
- an array of classifiers.
- Throws: Exception
- if an error occurs
All Packages Class Hierarchy This Package Previous Next Index WEKA's home