|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.functions.SimpleLogistic
Class for building a logistic regression model using LogitBoost. Incorporates attribute selection by fitting simple regression functions in LogitBoost. For more information, see master thesis "Logistic Model Trees" (Niels Landwehr, 2003)
Valid options are:
-I iterations
Set fixed number of iterations for LogitBoost (instead of using cross-validation).
-S
Select the number of LogitBoost iterations that gives minimal error on the training set
(instead of using cross-validation).
-P
Minimize error on probabilities instead of misclassification error.
-M iterations
Set maximum number of iterations for LogitBoost.
-H iter
Set parameter for heuristic for early stopping of LogitBoost.
If enabled, the minimum is selected greedily, stopping if the current minimum has not changed
for iter iterations. By default, heuristic is enabled with value 50. Set to zero to disable heuristic.
Constructor Summary | |
SimpleLogistic()
Constructor for creating SimpleLogistic object with standard options. |
|
SimpleLogistic(int numBoostingIterations,
boolean useCrossValidation,
boolean errorOnProbabilities)
Constructor for creating SimpleLogistic object. |
Method Summary | |
void |
buildClassifier(Instances data)
Builds the logistic regression using LogitBoost. |
double[] |
distributionForInstance(Instance inst)
Returns class probabilities for an instance. |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
java.lang.String |
errorOnProbabilitiesTipText()
Returns the tip text for this property |
boolean |
getErrorOnProbabilities()
Get the value of errorOnProbabilities. |
int |
getHeuristicStop()
Get the value of heuristicStop. |
int |
getMaxBoostingIterations()
Get the value of maxBoostingIterations. |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
int |
getNumBoostingIterations()
Get the value of numBoostingIterations. |
int |
getNumRegressions()
Get the number of LogitBoost iterations performed (= the number of regression functions fit by LogitBoost). |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
boolean |
getUseCrossValidation()
Get the value of useCrossValidation. |
java.lang.String |
globalInfo()
Returns a string describing classifier |
java.lang.String |
heuristicStopTipText()
Returns the tip text for this property |
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 |
maxBoostingIterationsTipText()
Returns the tip text for this property |
double |
measureAttributesUsed()
Returns the fraction of all attributes in the data that are used in the logistic model (in percent). |
java.lang.String |
numBoostingIterationsTipText()
Returns the tip text for this property |
void |
setErrorOnProbabilities(boolean l)
Set the value of errorOnProbabilities. |
void |
setHeuristicStop(int n)
Set the value of heuristicStop. |
void |
setMaxBoostingIterations(int n)
Set the value of maxBoostingIterations. |
void |
setNumBoostingIterations(int n)
Set the value of numBoostingIterations. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setUseCrossValidation(boolean l)
Set the value of useCrossValidation. |
java.lang.String |
toString()
Returns a description of the logistic model (attributes/coefficients). |
java.lang.String |
useCrossValidationTipText()
Returns the tip text for this property |
Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SimpleLogistic()
public SimpleLogistic(int numBoostingIterations, boolean useCrossValidation, boolean errorOnProbabilities)
numBoostingIterations
- if non-negative, use this as fixed number of iterations for LogitBoostuseCrossValidation
- cross-validate number of LogitBoost iterations.errorOnProbabilities
- minimize error on probabilities instead of misclassification errorMethod Detail |
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- the training data
java.lang.Exception
- if something goes wrongpublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
distributionForInstance
in class Classifier
inst
- the instance to be classified
java.lang.Exception
- if distribution can't be computed successfullypublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- 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 OptionHandler
getOptions
in class Classifier
public int getNumBoostingIterations()
public boolean getUseCrossValidation()
public boolean getErrorOnProbabilities()
public int getMaxBoostingIterations()
public int getHeuristicStop()
public void setNumBoostingIterations(int n)
public void setUseCrossValidation(boolean l)
public void setErrorOnProbabilities(boolean l)
public void setMaxBoostingIterations(int n)
public void setHeuristicStop(int n)
public int getNumRegressions()
public java.lang.String toString()
toString
in class java.lang.Object
public double measureAttributesUsed()
public java.util.Enumeration 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 value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String globalInfo()
public java.lang.String numBoostingIterationsTipText()
public java.lang.String useCrossValidationTipText()
public java.lang.String errorOnProbabilitiesTipText()
public java.lang.String maxBoostingIterationsTipText()
public java.lang.String heuristicStopTipText()
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London