|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.MultipleClassifiersCombiner
weka.classifiers.RandomizableMultipleClassifiersCombiner
weka.classifiers.meta.MultiScheme
public class MultiScheme
Class for selecting a classifier from among several using cross validation on the training data or the performance on the training data. Performance is measured based on percent correct (classification) or mean-squared error (regression).
Valid options are:-X <number of folds> Use cross validation for model selection using the given number of folds. (default 0, is to use training error)
-S <num> Random number seed. (default 1)
-B <classifier specification> Full class name of classifier to include, followed by scheme options. May be specified multiple times. (default: "weka.classifiers.rules.ZeroR")
-D If set, classifier is run in debug mode and may output additional info to the console
Constructor Summary | |
---|---|
MultiScheme()
|
Method Summary | |
---|---|
void |
buildClassifier(Instances data)
Buildclassifier selects a classifier from the set of classifiers by minimising error on the training data. |
java.lang.String |
classifiersTipText()
Returns the tip text for this property |
java.lang.String |
debugTipText()
Returns the tip text for this property |
double[] |
distributionForInstance(Instance instance)
Returns class probabilities. |
int |
getBestClassifierIndex()
Get the index of the classifier that was determined as best during cross-validation. |
Classifier |
getClassifier(int index)
Gets a single classifier from the set of available classifiers. |
Classifier[] |
getClassifiers()
Gets the list of possible classifers to choose from. |
boolean |
getDebug()
Get whether debugging is turned on |
int |
getNumFolds()
Gets the number of folds for cross-validation. |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.lang.String |
getRevision()
Returns the revision string. |
int |
getSeed()
Gets the random number seed. |
java.lang.String |
globalInfo()
Returns a string describing classifier |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
numFoldsTipText()
Returns the tip text for this property |
java.lang.String |
seedTipText()
Returns the tip text for this property |
void |
setClassifiers(Classifier[] classifiers)
Sets the list of possible classifers to choose from. |
void |
setDebug(boolean debug)
Set debugging mode |
void |
setNumFolds(int numFolds)
Sets the number of folds for cross-validation. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSeed(int seed)
Sets the seed for random number generation. |
java.lang.String |
toString()
Output a representation of this classifier |
Methods inherited from class weka.classifiers.MultipleClassifiersCombiner |
---|
getCapabilities |
Methods inherited from class weka.classifiers.Classifier |
---|
classifyInstance, forName, makeCopies, makeCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiScheme()
Method Detail |
---|
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableMultipleClassifiersCombiner
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-X <number of folds> Use cross validation for model selection using the given number of folds. (default 0, is to use training error)
-S <num> Random number seed. (default 1)
-B <classifier specification> Full class name of classifier to include, followed by scheme options. May be specified multiple times. (default: "weka.classifiers.rules.ZeroR")
-D If set, classifier is run in debug mode and may output additional info to the console
setOptions
in interface OptionHandler
setOptions
in class RandomizableMultipleClassifiersCombiner
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
getOptions
in class RandomizableMultipleClassifiersCombiner
public java.lang.String classifiersTipText()
classifiersTipText
in class MultipleClassifiersCombiner
public void setClassifiers(Classifier[] classifiers)
setClassifiers
in class MultipleClassifiersCombiner
classifiers
- an array of classifiers with all options set.public Classifier[] getClassifiers()
getClassifiers
in class MultipleClassifiersCombiner
public Classifier getClassifier(int index)
getClassifier
in class MultipleClassifiersCombiner
index
- the index of the classifier wanted
public java.lang.String seedTipText()
seedTipText
in class RandomizableMultipleClassifiersCombiner
public void setSeed(int seed)
setSeed
in interface Randomizable
setSeed
in class RandomizableMultipleClassifiersCombiner
seed
- the random number seedpublic int getSeed()
getSeed
in interface Randomizable
getSeed
in class RandomizableMultipleClassifiersCombiner
public java.lang.String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int numFolds)
numFolds
- the number of folds for cross-validationpublic java.lang.String debugTipText()
debugTipText
in class Classifier
public void setDebug(boolean debug)
setDebug
in class Classifier
debug
- true if debug output should be printedpublic boolean getDebug()
getDebug
in class Classifier
public int getBestClassifierIndex()
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- the training data to be used for generating the
boosted classifier.
java.lang.Exception
- if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if instance could not be classified
successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] argv)
argv
- should contain the following arguments:
-t training file [-T test file] [-c class index]
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |