|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.meta.RegressionByDiscretization
public class RegressionByDiscretization
A regression scheme that employs any classifier on a copy of the data that has the class attribute (equal-width) 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:-B <int> Number of bins for equal-width discretization (default 10).
-E Whether to delete empty bins after discretization (default false).
-F Use equal-frequency instead of equal-width discretization.
-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).
| Constructor Summary | |
|---|---|
RegressionByDiscretization()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
buildClassifier(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance instance)
Returns a predicted class for the test instance. |
java.lang.String |
deleteEmptyBinsTipText()
Returns the tip text for this property |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
boolean |
getDeleteEmptyBins()
Gets the number of bins numeric attributes will be divided into |
int |
getNumBins()
Gets the number of bins numeric attributes will be divided into |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.lang.String |
getRevision()
Returns the revision string. |
boolean |
getUseEqualFrequency()
Get the value of UseEqualFrequency. |
java.lang.String |
globalInfo()
Returns a string describing 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. |
java.lang.String |
numBinsTipText()
Returns the tip text for this property |
void |
setDeleteEmptyBins(boolean b)
Sets the number of bins to divide each selected numeric attribute into |
void |
setNumBins(int numBins)
Sets the number of bins to divide each selected numeric attribute into |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setUseEqualFrequency(boolean newUseEqualFrequency)
Set the value of UseEqualFrequency. |
java.lang.String |
toString()
Returns a description of the classifier. |
java.lang.String |
useEqualFrequencyTipText()
Returns the tip text for this property |
| Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
classifierTipText, getClassifier, setClassifier |
| Methods inherited from class weka.classifiers.Classifier |
|---|
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RegressionByDiscretization()
| Method Detail |
|---|
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class SingleClassifierEnhancerCapabilities
public void buildClassifier(Instances instances)
throws java.lang.Exception
buildClassifier in class Classifierinstances - set of instances serving as training data
java.lang.Exception - if the classifier has not been generated successfully
public double classifyInstance(Instance instance)
throws java.lang.Exception
classifyInstance in class Classifierinstance - the instance to be classified
java.lang.Exception - if the prediction couldn't be madepublic java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class SingleClassifierEnhancer
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
-B <int> Number of bins for equal-width discretization (default 10).
-E Whether to delete empty bins after discretization (default false).
-F Use equal-frequency instead of equal-width discretization.
-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).
setOptions in interface OptionHandlersetOptions in class SingleClassifierEnhanceroptions - the list of options as an array of strings
java.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class SingleClassifierEnhancerpublic java.lang.String numBinsTipText()
public int getNumBins()
public void setNumBins(int numBins)
numBins - the number of binspublic java.lang.String deleteEmptyBinsTipText()
public boolean getDeleteEmptyBins()
public void setDeleteEmptyBins(boolean b)
numBins - the number of binspublic java.lang.String useEqualFrequencyTipText()
public boolean getUseEqualFrequency()
public void setUseEqualFrequency(boolean newUseEqualFrequency)
newUseEqualFrequency - Value to assign to UseEqualFrequency.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(java.lang.String[] argv)
argv - the options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||