public class OrdinalClassClassifier
extends weka.classifiers.SingleClassifierEnhancer
implements weka.core.OptionHandler, weka.core.TechnicalInformationHandler
@inproceedings{Frank2001, author = {Eibe Frank and Mark Hall}, booktitle = {12th European Conference on Machine Learning}, pages = {145-156}, publisher = {Springer}, title = {A Simple Approach to Ordinal Classification}, year = {2001} } @inproceedings{Schapire2002, author = {Robert E. Schapire and Peter Stone and David A. McAllester and Michael L. Littman and Janos A. Csirik}, booktitle = {Machine Learning, Proceedings of the Nineteenth International Conference (ICML 2002)}, pages = {546-553}, publisher = {Morgan Kaufmann}, title = {Modeling Auction Price Uncertainty Using Boosting-based Conditional Density Estimation}, year = {2002} }Valid options are:
-S Turn off Schapire et al.'s smoothing heuristic (ICML02, pp. 550).
-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.trees.J48)
Options specific to classifier weka.classifiers.trees.J48:
-U Use unpruned tree.
-C <pruning confidence> Set confidence threshold for pruning. (default 0.25)
-M <minimum number of instances> Set minimum number of instances per leaf. (default 2)
-R Use reduced error pruning.
-N <number of folds> Set number of folds for reduced error pruning. One fold is used as pruning set. (default 3)
-B Use binary splits only.
-S Don't perform subtree raising.
-L Do not clean up after the tree has been built.
-A Laplace smoothing for predicted probabilities.
-Q <seed> Seed for random data shuffling (default 1).
OptionHandler
,
Serialized FormConstructor and Description |
---|
OrdinalClassClassifier()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(weka.core.Instances insts)
Builds the classifiers.
|
double[] |
distributionForInstance(weka.core.Instance inst)
Returns the distribution for an instance.
|
double[][] |
distributionsForInstances(weka.core.Instances insts)
Returns the distributions for a set of instances.
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
weka.core.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.
|
boolean |
getUseSmoothing()
Checks whether Schapire et al.'s smoothing method is used.
|
java.lang.String |
globalInfo()
Returns a string describing this attribute evaluator
|
boolean |
implementsMoreEfficientBatchPrediction()
Returns true if the base classifier implements BatchPredictor and is able
to generate batch predictions efficiently
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setUseSmoothing(boolean b)
Determines whether Schapire et al.'s smoothing method is used.
|
java.lang.String |
toString()
Prints the classifiers.
|
java.lang.String |
useSmoothingTipText()
Tip text method.
|
classifierTipText, getClassifier, postExecution, preExecution, setClassifier
batchSizeTipText, classifyInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
public java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.classifiers.Classifier
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.SingleClassifierEnhancer
public void buildClassifier(weka.core.Instances insts) throws java.lang.Exception
buildClassifier
in interface weka.classifiers.Classifier
insts
- the training data.java.lang.Exception
- if a classifier can't be builtpublic double[] distributionForInstance(weka.core.Instance inst) throws java.lang.Exception
distributionForInstance
in interface weka.classifiers.Classifier
distributionForInstance
in class weka.classifiers.AbstractClassifier
inst
- the instance to compute the distribution forjava.lang.Exception
- if the distribution can't be computed successfullypublic boolean implementsMoreEfficientBatchPrediction()
implementsMoreEfficientBatchPrediction
in interface weka.core.BatchPredictor
implementsMoreEfficientBatchPrediction
in class weka.classifiers.AbstractClassifier
public double[][] distributionsForInstances(weka.core.Instances insts) throws java.lang.Exception
distributionsForInstances
in interface weka.core.BatchPredictor
distributionsForInstances
in class weka.classifiers.AbstractClassifier
insts
- the instances to compute the distribution forjava.lang.Exception
- if the distribution can't be computed successfullypublic java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.classifiers.SingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S Turn off Schapire et al.'s smoothing heuristic (ICML02, pp. 550).
-W Full name of base classifier. (default: weka.classifiers.trees.J48)
Options specific to classifier weka.classifiers.trees.J48:
-U Use unpruned tree.
-C <pruning confidence> Set confidence threshold for pruning. (default 0.25)
-M <minimum number of instances> Set minimum number of instances per leaf. (default 2)
-R Use reduced error pruning.
-N <number of folds> Set number of folds for reduced error pruning. One fold is used as pruning set. (default 3)
-B Use binary splits only.
-S Don't perform subtree raising.
-L Do not clean up after the tree has been built.
-A Laplace smoothing for predicted probabilities.
-Q <seed> Seed for random data shuffling (default 1).
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.classifiers.SingleClassifierEnhancer
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 weka.core.OptionHandler
getOptions
in class weka.classifiers.SingleClassifierEnhancer
public java.lang.String useSmoothingTipText()
public void setUseSmoothing(boolean b)
b
- true if the smoothing heuristic is to be used.public boolean getUseSmoothing()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.classifiers.AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the options