|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.RandomizableSingleClassifierEnhancer
weka.classifiers.meta.CVParameterSelection
public class CVParameterSelection
Class for performing parameter selection by cross-validation for any classifier.
For more information, see:
R. Kohavi (1995). Wrappers for Performance Enhancement and Oblivious Decision Graphs. Department of Computer Science, Stanford University.
@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.
| Field Summary |
|---|
| Fields inherited from interface weka.core.Drawable |
|---|
BayesNet, Newick, NOT_DRAWABLE, TREE |
| Constructor Summary | |
|---|---|
CVParameterSelection()
|
|
| Method Summary | |
|---|---|
void |
addCVParameter(String cvParam)
Adds a scheme parameter to the list of parameters to be set by cross-validation |
void |
buildClassifier(Instances instances)
Generates the classifier. |
String |
CVParametersTipText()
Returns the tip text for this property |
double[] |
distributionForInstance(Instance instance)
Predicts the class distribution for the given test instance. |
String[] |
getBestClassifierOptions()
Returns (a copy of) the best options found for the classifier. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
String |
getCVParameter(int index)
Gets the scheme paramter with the given index. |
Object[] |
getCVParameters()
Get method for CVParameters. |
int |
getNumFolds()
Gets the number of folds for the cross-validation. |
String[] |
getOptions()
Gets the current settings of the Classifier. |
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. |
String |
globalInfo()
Returns a string describing this classifier |
String |
graph()
Returns graph describing the classifier (if possible). |
int |
graphType()
Returns the type of graph this classifier represents. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] argv)
Main method for testing this class. |
String |
numFoldsTipText()
Returns the tip text for this property |
void |
setCVParameters(Object[] params)
Set method for CVParameters. |
void |
setNumFolds(int numFolds)
Sets the number of folds for the cross-validation. |
void |
setOptions(String[] options)
Parses a given list of options. |
String |
toString()
Returns description of the cross-validated classifier. |
String |
toSummaryString()
A concise description of the model. |
| Methods inherited from class weka.classifiers.RandomizableSingleClassifierEnhancer |
|---|
getSeed, seedTipText, setSeed |
| Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
classifierTipText, getClassifier, setClassifier |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CVParameterSelection()
| Method Detail |
|---|
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class RandomizableSingleClassifierEnhancer
public void setOptions(String[] options)
throws 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 OptionHandlersetOptions in class RandomizableSingleClassifierEnhanceroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class RandomizableSingleClassifierEnhancerpublic String[] getBestClassifierOptions()
public Capabilities getCapabilities()
getCapabilities in interface ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class SingleClassifierEnhancerCapabilities
public void buildClassifier(Instances instances)
throws Exception
buildClassifier in interface Classifierinstances - set of instances serving as training data
Exception - if the classifier has not been generated successfully
public double[] distributionForInstance(Instance instance)
throws Exception
distributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinstance - the instance to be classified
Exception - if an error occurred during the prediction
public void addCVParameter(String cvParam)
throws Exception
cvParam - the string representation of a scheme parameter. The
format is: Exception - if the parameter specifier is of the wrong formatpublic String getCVParameter(int index)
index - the index for the parameter
public String CVParametersTipText()
public Object[] getCVParameters()
public void setCVParameters(Object[] params)
throws Exception
params - the CVParameters to use
Exception - if the setting of the CVParameters failspublic String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int numFolds)
throws Exception
numFolds - the number of folds for the cross-validation
Exception - if parameter illegalpublic int graphType()
graphType in interface Drawable
public String graph()
throws Exception
graph in interface DrawableException - if the classifier cannot be graphedpublic String toString()
toString in class Objectpublic String toSummaryString()
toSummaryString in interface Summarizablepublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClassifierpublic static void main(String[] argv)
argv - the options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||