public class MultiScheme extends RandomizableMultipleClassifiersCombiner
-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
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
MultiScheme() |
Modifier and Type | Method and Description |
---|---|
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<Option> |
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
|
getCapabilities, postExecution, preExecution
batchSizeTipText, classifyInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public java.util.Enumeration<Option> 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 stringsjava.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 wantedpublic 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 AbstractClassifier
public void setDebug(boolean debug)
setDebug
in class AbstractClassifier
debug
- true if debug output should be printedpublic boolean getDebug()
getDebug
in class AbstractClassifier
public int getBestClassifierIndex()
public void buildClassifier(Instances data) throws java.lang.Exception
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 interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance to be classifiedjava.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 AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- should contain the following arguments:
-t training file [-T test file] [-c class index]