类 SimpleLogistic
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.functions.SimpleLogistic
- 所有已实现的接口:
Serializable
,Cloneable
,AdditionalMeasureProducer
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
,WeightedInstancesHandler
public class SimpleLogistic
extends Classifier
implements OptionHandler, AdditionalMeasureProducer, WeightedInstancesHandler, TechnicalInformationHandler
Classifier for building linear logistic regression models. LogitBoost with simple regression functions as base learners is used for fitting the logistic models. The optimal number of LogitBoost iterations to perform is cross-validated, which leads to automatic attribute selection. For more information see:
Niels Landwehr, Mark Hall, Eibe Frank (2005). Logistic Model Trees.
Marc Sumner, Eibe Frank, Mark Hall: Speeding up Logistic Model Tree Induction. In: 9th European Conference on Principles and Practice of Knowledge Discovery in Databases, 675-683, 2005. BibTeX:
Niels Landwehr, Mark Hall, Eibe Frank (2005). Logistic Model Trees.
Marc Sumner, Eibe Frank, Mark Hall: Speeding up Logistic Model Tree Induction. In: 9th European Conference on Principles and Practice of Knowledge Discovery in Databases, 675-683, 2005. BibTeX:
@article{Landwehr2005, author = {Niels Landwehr and Mark Hall and Eibe Frank}, booktitle = {Machine Learning}, number = {1-2}, pages = {161-205}, title = {Logistic Model Trees}, volume = {95}, year = {2005} } @inproceedings{Sumner2005, author = {Marc Sumner and Eibe Frank and Mark Hall}, booktitle = {9th European Conference on Principles and Practice of Knowledge Discovery in Databases}, pages = {675-683}, publisher = {Springer}, title = {Speeding up Logistic Model Tree Induction}, year = {2005} }Valid options are:
-I <iterations> Set fixed number of iterations for LogitBoost
-S Use stopping criterion on training set (instead of cross-validation)
-P Use error on probabilities (rmse) instead of misclassification error for stopping criterion
-M <iterations> Set maximum number of boosting iterations
-H <iterations> 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.
-W <beta> Set beta for weight trimming for LogitBoost. Set to 0 for no weight trimming.
-A The AIC is used to choose the best iteration (instead of CV or training error).
- 版本:
- $Revision: 5523 $
- 作者:
- Niels Landwehr, Marc Sumner
- 另请参阅:
-
构造器概要
构造器构造器说明Constructor for creating SimpleLogistic object with standard options.SimpleLogistic
(int numBoostingIterations, boolean useCrossValidation, boolean errorOnProbabilities) Constructor for creating SimpleLogistic object. -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances data) Builds the logistic regression using LogitBoost.double[]
Returns class probabilities for an instance.Returns an enumeration of the additional measure namesReturns the tip text for this propertyReturns default capabilities of the classifier.boolean
Get the value of errorOnProbabilities.int
Get the value of heuristicStop.int
Get the value of maxBoostingIterations.double
getMeasure
(String additionalMeasureName) Returns the value of the named measureint
Get the value of numBoostingIterations.int
Get the number of LogitBoost iterations performed (= the number of regression functions fit by LogitBoost).String[]
Gets the current settings of the Classifier.Returns the revision string.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
Get the value of useAIC.boolean
Get the value of useCrossValidation.double
Get the value of weightTrimBeta.Returns a string describing classifierReturns the tip text for this propertyReturns an enumeration describing the available options.static void
Main method for testing this classReturns the tip text for this propertydouble
Returns the fraction of all attributes in the data that are used in the logistic model (in percent).Returns the tip text for this propertyvoid
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
(String[] options) Parses a given list of options.void
setUseAIC
(boolean c) Set the value of useAIC.void
setUseCrossValidation
(boolean l) Set the value of useCrossValidation.void
setWeightTrimBeta
(double n) Set the value of weightTrimBeta.toString()
Returns a description of the logistic model (attributes/coefficients).Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this property从类继承的方法 weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
-
构造器详细资料
-
SimpleLogistic
public SimpleLogistic()Constructor for creating SimpleLogistic object with standard options. -
SimpleLogistic
public SimpleLogistic(int numBoostingIterations, boolean useCrossValidation, boolean errorOnProbabilities) Constructor for creating SimpleLogistic object.- 参数:
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 error
-
-
方法详细资料
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Builds the logistic regression using LogitBoost.- 指定者:
buildClassifier
在类中Classifier
- 参数:
data
- the training data- 抛出:
Exception
- if something goes wrong
-
distributionForInstance
Returns class probabilities for an instance.- 覆盖:
distributionForInstance
在类中Classifier
- 参数:
inst
- the instance to compute the probabilities for- 返回:
- the probabilities
- 抛出:
Exception
- if distribution can't be computed successfully
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中Classifier
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-I <iterations> Set fixed number of iterations for LogitBoost
-S Use stopping criterion on training set (instead of cross-validation)
-P Use error on probabilities (rmse) instead of misclassification error for stopping criterion
-M <iterations> Set maximum number of boosting iterations
-H <iterations> 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.
-W <beta> Set beta for weight trimming for LogitBoost. Set to 0 for no weight trimming.
-A The AIC is used to choose the best iteration (instead of CV or training error).
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中Classifier
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Classifier.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中Classifier
- 返回:
- an array of strings suitable for passing to setOptions
-
getNumBoostingIterations
public int getNumBoostingIterations()Get the value of numBoostingIterations.- 返回:
- the number of boosting iterations
-
getUseCrossValidation
public boolean getUseCrossValidation()Get the value of useCrossValidation.- 返回:
- true if cross-validation is used
-
getErrorOnProbabilities
public boolean getErrorOnProbabilities()Get the value of errorOnProbabilities.- 返回:
- If true, use minimize error on probabilities instead of misclassification error
-
getMaxBoostingIterations
public int getMaxBoostingIterations()Get the value of maxBoostingIterations.- 返回:
- the maximum number of boosting iterations
-
getHeuristicStop
public int getHeuristicStop()Get the value of heuristicStop.- 返回:
- the value of heuristicStop
-
getWeightTrimBeta
public double getWeightTrimBeta()Get the value of weightTrimBeta. -
getUseAIC
public boolean getUseAIC()Get the value of useAIC.- 返回:
- Value of useAIC.
-
setNumBoostingIterations
public void setNumBoostingIterations(int n) Set the value of numBoostingIterations.- 参数:
n
- the number of boosting iterations
-
setUseCrossValidation
public void setUseCrossValidation(boolean l) Set the value of useCrossValidation.- 参数:
l
- whether to use cross-validation
-
setErrorOnProbabilities
public void setErrorOnProbabilities(boolean l) Set the value of errorOnProbabilities.- 参数:
l
- If true, use minimize error on probabilities instead of misclassification error
-
setMaxBoostingIterations
public void setMaxBoostingIterations(int n) Set the value of maxBoostingIterations.- 参数:
n
- the maximum number of boosting iterations
-
setHeuristicStop
public void setHeuristicStop(int n) Set the value of heuristicStop.- 参数:
n
- the value of heuristicStop
-
setWeightTrimBeta
public void setWeightTrimBeta(double n) Set the value of weightTrimBeta. -
setUseAIC
public void setUseAIC(boolean c) Set the value of useAIC.- 参数:
c
- Value to assign to useAIC.
-
getNumRegressions
public int getNumRegressions()Get the number of LogitBoost iterations performed (= the number of regression functions fit by LogitBoost).- 返回:
- the number of LogitBoost iterations performed
-
toString
Returns a description of the logistic model (attributes/coefficients). -
measureAttributesUsed
public double measureAttributesUsed()Returns the fraction of all attributes in the data that are used in the logistic model (in percent). An attribute is used in the model if it is used in any of the models for the different classes.- 返回:
- percentage of attributes used in the model
-
enumerateMeasures
Returns an enumeration of the additional measure names- 指定者:
enumerateMeasures
在接口中AdditionalMeasureProducer
- 返回:
- an enumeration of the measure names
-
getMeasure
Returns the value of the named measure- 指定者:
getMeasure
在接口中AdditionalMeasureProducer
- 参数:
additionalMeasureName
- the name of the measure to query for its value- 返回:
- the value of the named measure
- 抛出:
IllegalArgumentException
- if the named measure is not supported
-
globalInfo
Returns a string describing classifier- 返回:
- a description suitable for displaying in the explorer/experimenter gui
-
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.- 指定者:
getTechnicalInformation
在接口中TechnicalInformationHandler
- 返回:
- the technical information about this class
-
numBoostingIterationsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
useCrossValidationTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
errorOnProbabilitiesTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
maxBoostingIterationsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
heuristicStopTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
weightTrimBetaTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
useAICTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for testing this class- 参数:
argv
- commandline options
-