public class CVParameterSelection extends RandomizableSingleClassifierEnhancer implements Drawable, Summarizable, TechnicalInformationHandler
@phdthesis{Kohavi1995, address = {Department of Computer Science, Stanford University}, author = {R. Kohavi}, school = {Stanford University}, title = {Wrappers for Performance Enhancement and Oblivious Decision Graphs}, year = {1995} }Valid options are:
-X <number of folds> Number of folds used for cross validation (default 10).
-P <classifier parameter> Classifier parameter options. eg: "N 1 5 10" Sets an optimisation parameter for the classifier with name -N, with lower bound 1, upper bound 5, and 10 optimisation steps. The upper bound may be the character 'A' or 'I' to substitute the number of attributes or instances in the training data, respectively. This parameter may be supplied more than once to optimise over several classifier options simultaneously.
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after -- are passed to the designated sub-classifier.
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
CVParameterSelection() |
Modifier and Type | Method and Description |
---|---|
void |
addCVParameter(java.lang.String cvParam)
Adds a scheme parameter to the list of parameters to be set
by cross-validation
|
void |
buildClassifier(Instances instances)
Generates the classifier.
|
java.lang.String |
CVParametersTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance instance)
Predicts the class distribution for the given test instance.
|
java.lang.String[] |
getBestClassifierOptions()
Returns (a copy of) the best options found for the classifier.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
java.lang.String |
getCVParameter(int index)
Gets the scheme paramter with the given index.
|
java.lang.Object[] |
getCVParameters()
Get method for CVParameters.
|
int |
getNumFolds()
Gets the number of folds for the cross-validation.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing this classifier
|
java.lang.String |
graph()
Returns graph describing the classifier (if possible).
|
int |
graphType()
Returns the type of graph this classifier
represents.
|
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
|
void |
setCVParameters(java.lang.Object[] params)
Set method for CVParameters.
|
void |
setNumFolds(int numFolds)
Sets the number of folds for the cross-validation.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Returns description of the cross-validated classifier.
|
java.lang.String |
toSummaryString()
A concise description of the model.
|
getSeed, seedTipText, setSeed
classifierTipText, getClassifier, postExecution, preExecution, setClassifier
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableSingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-X <number of folds> Number of folds used for cross validation (default 10).
-P <classifier parameter> Classifier parameter options. eg: "N 1 5 10" Sets an optimisation parameter for the classifier with name -N, with lower bound 1, upper bound 5, and 10 optimisation steps. The upper bound may be the character 'A' or 'I' to substitute the number of attributes or instances in the training data, respectively. This parameter may be supplied more than once to optimise over several classifier options simultaneously.
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after -- are passed to the designated sub-classifier.
setOptions
in interface OptionHandler
setOptions
in class RandomizableSingleClassifierEnhancer
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 RandomizableSingleClassifierEnhancer
public java.lang.String[] getBestClassifierOptions()
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class SingleClassifierEnhancer
Capabilities
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in interface Classifier
instances
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been generated 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 an error occurred during the predictionpublic void addCVParameter(java.lang.String cvParam) throws java.lang.Exception
cvParam
- the string representation of a scheme parameter. The
format is: java.lang.Exception
- if the parameter specifier is of the wrong formatpublic java.lang.String getCVParameter(int index)
index
- the index for the parameterpublic java.lang.String CVParametersTipText()
public java.lang.Object[] getCVParameters()
public void setCVParameters(java.lang.Object[] params) throws java.lang.Exception
params
- the CVParameters to usejava.lang.Exception
- if the setting of the CVParameters failspublic java.lang.String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int numFolds) throws java.lang.Exception
numFolds
- the number of folds for the cross-validationjava.lang.Exception
- if parameter illegalpublic int graphType()
public java.lang.String graph() throws java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toSummaryString()
toSummaryString
in interface Summarizable
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the options