类 LibLINEAR
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.functions.LibLINEAR
- 所有已实现的接口:
Serializable
,Cloneable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
A wrapper class for the liblinear tools (the liblinear classes, typically the jar file, need to be in the classpath to use this classifier).
Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, Chih-Jen Lin (2008). LIBLINEAR - A Library for Large Linear Classification. URL http://www.csie.ntu.edu.tw/~cjlin/liblinear/. BibTeX:
Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, Chih-Jen Lin (2008). LIBLINEAR - A Library for Large Linear Classification. URL http://www.csie.ntu.edu.tw/~cjlin/liblinear/. BibTeX:
@misc{Fan2008, author = {Rong-En Fan and Kai-Wei Chang and Cho-Jui Hsieh and Xiang-Rui Wang and Chih-Jen Lin}, note = {The Weka classifier works with version 1.33 of LIBLINEAR}, title = {LIBLINEAR - A Library for Large Linear Classification}, year = {2008}, URL = {http://www.csie.ntu.edu.tw/\~cjlin/liblinear/} }Valid options are:
-S <int> Set type of solver (default: 1) 0 = L2-regularized logistic regression 1 = L2-loss support vector machines (dual) 2 = L2-loss support vector machines (primal) 3 = L1-loss support vector machines (dual) 4 = multi-class support vector machines by Crammer and Singer
-C <double> Set the cost parameter C (default: 1)
-Z Turn on normalization of input data (default: off)
-N Turn on nominal to binary conversion.
-M Turn off missing value replacement. WARNING: use only if your data has no missing values.
-P Use probability estimation (default: off) currently for L2-regularized logistic regression only!
-E <double> Set tolerance of termination criterion (default: 0.01)
-W <double> Set the parameters C of class i to weight[i]*C (default: 1)
-B <double> Add Bias term with the given value if >= 0; if < 0, no bias term added (default: 1)
-D If set, classifier is run in debug mode and may output additional info to the console
- 版本:
- $Revision: 5917 $
- 作者:
- Benedikt Waldvogel (mail at bwaldvogel.de)
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明static final int
SVM solver type L1-loss support vector machines (dual)static final int
SVM solver type L2-regularized logistic regressionstatic final int
SVM solver type L2-loss support vector machines (primal)static final int
SVM solver type L2-loss support vector machines (dual)static final int
SVM solver type multi-class support vector machines by Crammer and Singerstatic final Tag[]
SVM solver types -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the tip text for this propertyvoid
buildClassifier
(Instances insts) builds the classifierReturns the tip text for this propertyReturns the tip text for this propertydouble[]
distributionForInstance
(Instance instance) Computes the distribution for a given instance.Returns the tip text for this propertyReturns the tip text for this propertydouble
getBias()
Returns bias term value (default 1) No bias term is added if value < 0Returns default capabilities of the classifier.boolean
Gets whether conversion of nominal to binary is turned on.double
getCost()
Returns the cost parameter Cboolean
Gets whether automatic replacement of missing values is disabled.double
getEps()
Gets tolerance of termination criteriongetModel()
boolean
whether to normalize input dataString[]
Returns the current optionsboolean
Sets whether to generate probability estimates instead of -1/+1 for classification problems.Returns the revision string.Gets type of SVMReturns 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.Gets the parameters C of class i to weight[i]*C (default 1).Returns a string describing classifierstatic boolean
returns whether the liblinear classes are present or not, i.e.Returns an enumeration describing the available options.static void
Main method for testing this class.Returns the tip text for this propertyReturns the tip text for this propertyvoid
setBias
(double value) Sets bias term value (default 1) No bias term is added if value < 0void
setConvertNominalToBinary
(boolean b) Whether to turn on conversion of nominal attributes to binary.void
setCost
(double value) Sets the cost parameter C (default 1)void
setDoNotReplaceMissingValues
(boolean b) Whether to turn off automatic replacement of missing values.void
setEps
(double value) Sets tolerance of termination criterion (default 0.001)void
setNormalize
(boolean value) whether to normalize input datavoid
setOptions
(String[] options) Sets the classifier optionsvoid
setProbabilityEstimates
(boolean value) Returns whether probability estimates are generated instead of -1/+1 for classification problems.void
setSVMType
(SelectedTag value) Sets type of SVM (default SVMTYPE_L2)void
setWeights
(String weightsStr) Sets the parameters C of class i to weight[i]*C (default 1).Returns the tip text for this propertytoString()
returns a string representationReturns the tip text for this property从类继承的方法 weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
-
字段详细资料
-
SVMTYPE_L2_LR
public static final int SVMTYPE_L2_LRSVM solver type L2-regularized logistic regression- 另请参阅:
-
SVMTYPE_L2LOSS_SVM_DUAL
public static final int SVMTYPE_L2LOSS_SVM_DUALSVM solver type L2-loss support vector machines (dual)- 另请参阅:
-
SVMTYPE_L2LOSS_SVM
public static final int SVMTYPE_L2LOSS_SVMSVM solver type L2-loss support vector machines (primal)- 另请参阅:
-
SVMTYPE_L1LOSS_SVM_DUAL
public static final int SVMTYPE_L1LOSS_SVM_DUALSVM solver type L1-loss support vector machines (dual)- 另请参阅:
-
SVMTYPE_MCSVM_CS
public static final int SVMTYPE_MCSVM_CSSVM solver type multi-class support vector machines by Crammer and Singer- 另请参阅:
-
TAGS_SVMTYPE
SVM solver types
-
-
构造器详细资料
-
LibLINEAR
public LibLINEAR()
-
-
方法详细资料
-
getModel
-
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
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中Classifier
- 返回:
- an enumeration of all the available options.
-
setOptions
Sets the classifier options Valid options are:-S <int> Set type of solver (default: 1) 0 = L2-regularized logistic regression 1 = L2-loss support vector machines (dual) 2 = L2-loss support vector machines (primal) 3 = L1-loss support vector machines (dual) 4 = multi-class support vector machines by Crammer and Singer
-C <double> Set the cost parameter C (default: 1)
-Z Turn on normalization of input data (default: off)
-N Turn on nominal to binary conversion.
-M Turn off missing value replacement. WARNING: use only if your data has no missing values.
-P Use probability estimation (default: off) currently for L2-regularized logistic regression only!
-E <double> Set tolerance of termination criterion (default: 0.01)
-W <double> Set the parameters C of class i to weight[i]*C (default: 1)
-B <double> Add Bias term with the given value if >= 0; if < 0, no bias term added (default: 1)
-D If set, classifier is run in debug mode and may output additional info to the console
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中Classifier
- 参数:
options
- the options to parse- 抛出:
Exception
- if parsing fails
-
getOptions
Returns the current options- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中Classifier
- 返回:
- the current setup
-
isPresent
public static boolean isPresent()returns whether the liblinear classes are present or not, i.e. whether the classes are in the classpath or not- 返回:
- whether the liblinear classes are available
-
setSVMType
Sets type of SVM (default SVMTYPE_L2)- 参数:
value
- the type of the SVM
-
getSVMType
Gets type of SVM- 返回:
- the type of the SVM
-
SVMTypeTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setCost
public void setCost(double value) Sets the cost parameter C (default 1)- 参数:
value
- the cost value
-
getCost
public double getCost()Returns the cost parameter C- 返回:
- the cost value
-
costTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setEps
public void setEps(double value) Sets tolerance of termination criterion (default 0.001)- 参数:
value
- the tolerance
-
getEps
public double getEps()Gets tolerance of termination criterion- 返回:
- the current tolerance
-
epsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setBias
public void setBias(double value) Sets bias term value (default 1) No bias term is added if value < 0- 参数:
value
- the bias term value
-
getBias
public double getBias()Returns bias term value (default 1) No bias term is added if value < 0- 返回:
- the bias term value
-
biasTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
normalizeTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setNormalize
public void setNormalize(boolean value) whether to normalize input data- 参数:
value
- whether to normalize the data
-
getNormalize
public boolean getNormalize()whether to normalize input data- 返回:
- true, if the data is normalized
-
convertNominalToBinaryTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setConvertNominalToBinary
public void setConvertNominalToBinary(boolean b) Whether to turn on conversion of nominal attributes to binary.- 参数:
b
- true if nominal to binary conversion is to be turned on
-
getConvertNominalToBinary
public boolean getConvertNominalToBinary()Gets whether conversion of nominal to binary is turned on.- 返回:
- true if nominal to binary conversion is turned on.
-
doNotReplaceMissingValuesTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setDoNotReplaceMissingValues
public void setDoNotReplaceMissingValues(boolean b) Whether to turn off automatic replacement of missing values. Set to true only if the data does not contain missing values.- 参数:
b
- true if automatic missing values replacement is to be disabled.
-
getDoNotReplaceMissingValues
public boolean getDoNotReplaceMissingValues()Gets whether automatic replacement of missing values is disabled.- 返回:
- true if automatic replacement of missing values is disabled.
-
setWeights
Sets the parameters C of class i to weight[i]*C (default 1). Blank separated list of doubles.- 参数:
weightsStr
- the weights (doubles, separated by blanks)
-
getWeights
Gets the parameters C of class i to weight[i]*C (default 1). Blank separated doubles.- 返回:
- the weights (doubles separated by blanks)
-
weightsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setProbabilityEstimates
public void setProbabilityEstimates(boolean value) Returns whether probability estimates are generated instead of -1/+1 for classification problems.- 参数:
value
- whether to predict probabilities
-
getProbabilityEstimates
public boolean getProbabilityEstimates()Sets whether to generate probability estimates instead of -1/+1 for classification problems.- 返回:
- true, if probability estimates should be returned
-
probabilityEstimatesTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
distributionForInstance
Computes the distribution for a given instance.- 覆盖:
distributionForInstance
在类中Classifier
- 参数:
instance
- the instance for which distribution is computed- 返回:
- the distribution
- 抛出:
Exception
- if the distribution can't be computed successfully
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
builds the classifier- 指定者:
buildClassifier
在类中Classifier
- 参数:
insts
- the training instances- 抛出:
Exception
- if liblinear classes not in classpath or liblinear encountered a problem
-
toString
returns a string representation -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
args
- the options
-