public class IterativeClassifierOptimizer extends RandomizableClassifier implements AdditionalMeasureProducer
-A If set, average estimate is used rather than one estimate from pooled predictions.
-L <num> The number of iterations to look ahead for to find a better optimum. (default 50)
-P <int> The size of the thread pool, for example, the number of cores in the CPU. (default 1)
-E <int> The number of threads to use, which should be >= size of thread pool. (default 1)
-I <num> Step size for the evaluation, if evaluation is time consuming. (default 1)
-F <num> Number of folds for cross-validation. (default 10)
-R <num> Number of runs for cross-validation. (default 1)
-W Full name of base classifier. (default: weka.classifiers.meta.LogitBoost)
-metric <name> Evaluation metric to optimise (default rmse). Available metrics: correct,incorrect,kappa,total cost,average cost,kb relative,kb information, correlation,complexity 0,complexity scheme,complexity improvement, mae,rmse,rae,rrse,coverage,region size,tp rate,fp rate,precision,recall, f-measure,mcc,roc area,prc area
-class-value-index <0-based index> Class value index to optimise. Ignored for all but information-retrieval type metrics (such as roc area). If unspecified (or a negative value is supplied), and an information-retrieval metric is specified, then the class-weighted average metric used. (default -1)
-S <num> Random number seed. (default 1)
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
Options specific to classifier weka.classifiers.meta.LogitBoost:
-Q Use resampling instead of reweighting for boosting.
-P <percent> Percentage of weight mass to base training on. (default 100, reduce to around 90 speed up)
-L <num> Threshold on the improvement of the likelihood. (default -Double.MAX_VALUE)
-H <num> Shrinkage parameter. (default 1)
-Z <num> Z max threshold for responses. (default 3)
-O <int> The size of the thread pool, for example, the number of cores in the CPU. (default 1)
-E <int> The number of threads to use for batch prediction, which should be >= size of thread pool. (default 1)
-S <num> Random number seed. (default 1)
-I <num> Number of iterations. (default 10)
-percentage <num> The percentage of data to be used for training (if 0, k-fold cross-validation is used). (default 0)
-order Whether to preserve order when a percentage split evaluation is performed.
-W Full name of base classifier. (default: weka.classifiers.trees.DecisionStump)
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
Options specific to classifier weka.classifiers.trees.DecisionStump:
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
Modifier and Type | Field and Description |
---|---|
static Tag[] |
TAGS_EVAL |
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
IterativeClassifierOptimizer() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Builds the classifier.
|
java.lang.String |
classValueIndexTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance inst)
Returns the class distribution for an instance.
|
java.util.Enumeration<java.lang.String> |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
java.lang.String |
evaluationMetricTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns default capabilities of the base classifier.
|
int |
getClassValueIndex()
Get the class value index to use
|
SelectedTag |
getEvaluationMetric()
Get the evaluation metric to use
|
IterativeClassifier |
getIterativeClassifier()
Get the classifier used as the base learner.
|
int |
getLookAheadIterations()
Get the value of LookAheadIterations.
|
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure
|
int |
getNumFolds()
Get the value of NumFolds.
|
int |
getNumRuns()
Get the value of NumRuns.
|
int |
getNumThreads()
Gets the number of threads.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
int |
getPoolSize()
Gets the number of threads.
|
boolean |
getPreserveOrderInPercentageSplitEvaluation()
Get the value of PreserveOrderInPercentageSplitEvaluation.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getSplitPercentage()
Get the value of SplitPercentage.
|
int |
getStepSize()
Get the value of StepSize.
|
boolean |
getUseAverage()
Get the value of UseAverage.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.lang.String |
iterativeClassifierTipText()
Returns the tip text for this property
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
java.lang.String |
lookAheadIterationsTipText()
Returns the tip text for this property
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
double |
measureBestNumIts()
Returns the best number of iterations
|
double |
measureBestVal()
Returns the measure for the best model
|
java.lang.String |
numFoldsTipText()
Returns the tip text for this property
|
java.lang.String |
numRunsTipText()
Returns the tip text for this property
|
java.lang.String |
numThreadsTipText() |
java.lang.String |
poolSizeTipText() |
java.lang.String |
preserveOrderInPercentageSplitEvaluationTipText()
Returns the tip text for this property
|
void |
setClassValueIndex(int i)
Set the class value index to use
|
void |
setEvaluationMetric(SelectedTag metric)
Set the evaluation metric to use
|
void |
setIterativeClassifier(IterativeClassifier newIterativeClassifier)
Set the base learner.
|
void |
setLookAheadIterations(int newLookAheadIterations)
Set the value of LookAheadIterations.
|
void |
setNumFolds(int newNumFolds)
Set the value of NumFolds.
|
void |
setNumRuns(int newNumRuns)
Set the value of NumRuns.
|
void |
setNumThreads(int nT)
Sets the number of threads
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setPoolSize(int nT)
Sets the number of threads
|
void |
setPreserveOrderInPercentageSplitEvaluation(boolean newPreserveOrderInPercentageSplitEvaluation)
Set the value of PreserveOrderInPercentageSplitEvaluation.
|
void |
setSplitPercentage(double newSplitPercentage)
Set the value of SplitPercentage.
|
void |
setStepSize(int newStepSize)
Set the value of StepSize.
|
void |
setUseAverage(boolean newUseAverage)
Set the value of UseAverage.
|
java.lang.String |
splitPercentageTipText()
Returns the tip text for this property
|
java.lang.String |
stepSizeTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
Returns a string describing the classifier.
|
java.lang.String |
useAverageTipText()
Returns the tip text for this property
|
getSeed, seedTipText, setSeed
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public static Tag[] TAGS_EVAL
public java.lang.String globalInfo()
public java.lang.String useAverageTipText()
public boolean getUseAverage()
public void setUseAverage(boolean newUseAverage)
newUseAverage
- Value to assign to UseAverage.public java.lang.String numThreadsTipText()
public int getNumThreads()
public void setNumThreads(int nT)
public java.lang.String poolSizeTipText()
public int getPoolSize()
public void setPoolSize(int nT)
public java.lang.String stepSizeTipText()
public int getStepSize()
public void setStepSize(int newStepSize)
newStepSize
- Value to assign to StepSize.public java.lang.String numRunsTipText()
public int getNumRuns()
public void setNumRuns(int newNumRuns)
newNumRuns
- Value to assign to NumRuns.public java.lang.String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int newNumFolds)
newNumFolds
- Value to assign to NumFolds.public java.lang.String lookAheadIterationsTipText()
public int getLookAheadIterations()
public void setLookAheadIterations(int newLookAheadIterations)
newLookAheadIterations
- Value to assign to LookAheadIterations.public java.lang.String splitPercentageTipText()
public double getSplitPercentage()
public void setSplitPercentage(double newSplitPercentage)
newSplitPercentage
- Value to assign to SplitPercentage.public java.lang.String preserveOrderInPercentageSplitEvaluationTipText()
public boolean getPreserveOrderInPercentageSplitEvaluation()
public void setPreserveOrderInPercentageSplitEvaluation(boolean newPreserveOrderInPercentageSplitEvaluation)
newPreserveOrderInPercentageSplitEvaluation
- Value to assign to PreserveOrderInPercentageSplitEvaluation.public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in interface Classifier
data
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been
generated successfullypublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
inst
- the instance to be classifiedjava.lang.Exception
- if distribution could not be computed successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
setOptions
in class RandomizableClassifier
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 RandomizableClassifier
public java.lang.String evaluationMetricTipText()
public void setEvaluationMetric(SelectedTag metric)
metric
- the metric to usepublic SelectedTag getEvaluationMetric()
public java.lang.String classValueIndexTipText()
public void setClassValueIndex(int i)
i
- the class value index to usepublic int getClassValueIndex()
public java.lang.String iterativeClassifierTipText()
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public void setIterativeClassifier(IterativeClassifier newIterativeClassifier)
newIterativeClassifier
- the classifier to use.public IterativeClassifier getIterativeClassifier()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public double measureBestNumIts()
public double measureBestVal()
public java.util.Enumeration<java.lang.String> enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its valuejava.lang.IllegalArgumentException
- if the named measure is not supportedpublic static void main(java.lang.String[] argv)
argv
- the options