|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.RegressionByDiscretization
Class for a regression scheme that employs any distribution classifier on a copy of the data that has the class attribute discretized. The predicted value is the expected value of the mean class value for each discretized interval (based on the predicted probabilities for each interval).
Valid options are:
-D
Produce debugging output.
-W classname
Specify the full class name of a classifier as the basis for
regression (required).
-B num
The number of bins the class attribute will be discretized into.
(default 10)
-O
Optimize number of bins (values up to and including the -B option will
be considered). (default no debugging output)
Any options after -- will be passed to the sub-classifier.
Field Summary | |
protected DistributionClassifier |
m_Classifier
The subclassifier. |
protected double[] |
m_ClassMeans
The mean values for each Discretized class interval. |
protected boolean |
m_Debug
Whether debugging output will be printed |
protected DiscretizeFilter |
m_Discretizer
The discretization filter. |
protected int |
m_NumBins
The number of classes in the Discretized training data. |
protected boolean |
m_OptimizeBins
Whether the Discretizer will optimise the number of bins |
Constructor Summary | |
RegressionByDiscretization()
|
Method Summary | |
void |
buildClassifier(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance instance)
Returns a predicted class for the test instance. |
Classifier |
getClassifier()
Get the classifier used as the classifier |
boolean |
getDebug()
Gets whether debugging output will be printed |
int |
getNumBins()
Gets the number of bins the class attribute will be discretized into. |
boolean |
getOptimizeBins()
Gets whether the discretizer optimizes the number of bins |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
void |
setClassifier(Classifier newClassifier)
Set the classifier for boosting. |
void |
setDebug(boolean debug)
Sets whether debugging output will be printed |
void |
setNumBins(int numBins)
Sets the number of bins the class attribute will be discretized into. |
void |
setOptimizeBins(boolean optimize)
Sets whether the discretizer optimizes the number of bins |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Returns a description of the classifier. |
Methods inherited from class weka.classifiers.Classifier |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected DistributionClassifier m_Classifier
protected DiscretizeFilter m_Discretizer
protected int m_NumBins
protected double[] m_ClassMeans
protected boolean m_Debug
protected boolean m_OptimizeBins
Constructor Detail |
public RegressionByDiscretization()
Method Detail |
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been generated successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class Classifier
instance
- the instance to be classifiedjava.lang.Exception
- if the prediction couldn't be madepublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D
Produce debugging output.
-W classname
Specify the full class name of a classifier as the basis for
regression (required).
-B num
The number of bins the class attribute will be discretized into.
(default 10)
-O
Optimize number of bins (values up to and including the -B option will
be considered). (default no debugging output)
Any options after -- will be passed to the sub-classifier.
setOptions
in interface OptionHandler
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
public void setClassifier(Classifier newClassifier)
newClassifier
- the Classifier to use.public Classifier getClassifier()
public void setOptimizeBins(boolean optimize)
optimize
- true if the discretizer should optimize the number of binspublic boolean getOptimizeBins()
public void setDebug(boolean debug)
debug
- true if debug output should be printedpublic boolean getDebug()
public void setNumBins(int numBins)
numBins
- the number of bins to usepublic int getNumBins()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
argv
- the options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |