public class RegressionByDiscretization extends SingleClassifierEnhancer
-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).
Modifier and Type | Field and Description |
---|---|
protected double[] |
m_ClassMeans
The mean values for each Discretized class interval.
|
protected boolean |
m_DeleteEmptyBins
Whether to delete empty intervals.
|
protected Instances |
m_DiscretizedHeader
Header of discretized data.
|
protected Discretize |
m_Discretizer
The discretization filter.
|
protected int |
m_NumBins
The number of discretization intervals.
|
protected boolean |
m_UseEqualFrequency
Use equal-frequency binning
|
m_Classifier
m_Debug
Constructor and Description |
---|
RegressionByDiscretization()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances instances)
Generates the classifier.
|
double |
classifyInstance(Instance instance)
Returns a predicted class for the test instance.
|
protected String |
defaultClassifierString()
String describing default classifier.
|
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
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
boolean |
getUseEqualFrequency()
Get the value of UseEqualFrequency.
|
String |
globalInfo()
Returns a string describing classifier
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class.
|
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(String[] options)
Parses a given list of options.
|
void |
setUseEqualFrequency(boolean newUseEqualFrequency)
Set the value of UseEqualFrequency.
|
String |
toString()
Returns a description of the classifier.
|
String |
useEqualFrequencyTipText()
Returns the tip text for this property
|
classifierTipText, getClassifier, getClassifierSpec, setClassifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug
protected Discretize m_Discretizer
protected int m_NumBins
protected double[] m_ClassMeans
protected boolean m_DeleteEmptyBins
protected Instances m_DiscretizedHeader
protected boolean m_UseEqualFrequency
public RegressionByDiscretization()
public String globalInfo()
protected String defaultClassifierString()
defaultClassifierString
in class SingleClassifierEnhancer
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class SingleClassifierEnhancer
Capabilities
public void buildClassifier(Instances instances) throws Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training dataException
- if the classifier has not been generated successfullypublic double classifyInstance(Instance instance) throws Exception
classifyInstance
in class Classifier
instance
- the instance to be classifiedException
- if the prediction couldn't be madepublic Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SingleClassifierEnhancer
public void setOptions(String[] options) throws 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 OptionHandler
setOptions
in class SingleClassifierEnhancer
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SingleClassifierEnhancer
public String numBinsTipText()
public int getNumBins()
public void setNumBins(int numBins)
numBins
- the number of binspublic String deleteEmptyBinsTipText()
public boolean getDeleteEmptyBins()
public void setDeleteEmptyBins(boolean b)
numBins
- the number of binspublic String useEqualFrequencyTipText()
public boolean getUseEqualFrequency()
public void setUseEqualFrequency(boolean newUseEqualFrequency)
newUseEqualFrequency
- Value to assign to UseEqualFrequency.public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(String[] argv)
argv
- the optionsCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.