类 LWL
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.lazy.LWL
- 所有已实现的接口:
Serializable
,Cloneable
,UpdateableClassifier
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
,WeightedInstancesHandler
public class LWL
extends SingleClassifierEnhancer
implements UpdateableClassifier, WeightedInstancesHandler, TechnicalInformationHandler
Locally weighted learning. Uses an instance-based algorithm to assign instance weights which are then used by a specified WeightedInstancesHandler.
Can do classification (e.g. using naive Bayes) or regression (e.g. using linear regression).
For more info, see
Eibe Frank, Mark Hall, Bernhard Pfahringer: Locally Weighted Naive Bayes. In: 19th Conference in Uncertainty in Artificial Intelligence, 249-256, 2003.
C. Atkeson, A. Moore, S. Schaal (1996). Locally weighted learning. AI Review.. BibTeX:
Can do classification (e.g. using naive Bayes) or regression (e.g. using linear regression).
For more info, see
Eibe Frank, Mark Hall, Bernhard Pfahringer: Locally Weighted Naive Bayes. In: 19th Conference in Uncertainty in Artificial Intelligence, 249-256, 2003.
C. Atkeson, A. Moore, S. Schaal (1996). Locally weighted learning. AI Review.. BibTeX:
@inproceedings{Frank2003, author = {Eibe Frank and Mark Hall and Bernhard Pfahringer}, booktitle = {19th Conference in Uncertainty in Artificial Intelligence}, pages = {249-256}, publisher = {Morgan Kaufmann}, title = {Locally Weighted Naive Bayes}, year = {2003} } @article{Atkeson1996, author = {C. Atkeson and A. Moore and S. Schaal}, journal = {AI Review}, title = {Locally weighted learning}, year = {1996} }Valid options are:
-A The nearest neighbour search algorithm to use (default: weka.core.neighboursearch.LinearNNSearch).
-K <number of neighbours> Set the number of neighbours used to set the kernel bandwidth. (default all)
-U <number of weighting method> Set the weighting kernel shape to use. 0=Linear, 1=Epanechnikov, 2=Tricube, 3=Inverse, 4=Gaussian. (default 0 = Linear)
-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.DecisionStump)
Options specific to classifier weka.classifiers.trees.DecisionStump:
-D If set, classifier is run in debug mode and may output additional info to the console
- 版本:
- $Revision: 5011 $
- 作者:
- Len Trigg (trigg@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz), Ashraf M. Kibriya (amk14[at-the-rate]cs[dot]waikato[dot]ac[dot]nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances instances) Generates the classifier.double[]
distributionForInstance
(Instance instance) Calculates the class membership probabilities for the given test instance.Returns an enumeration of the additional measure names produced by the neighbour search algorithm.Returns default capabilities of the classifier.int
getKNN()
Gets the number of neighbours used for kernel bandwidth setting.double
getMeasure
(String additionalMeasureName) Returns the value of the named measure from the neighbour search algorithm.Returns the current nearestNeighbourSearch algorithm in use.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.int
Gets the kernel weighting method to use.Returns a string describing classifier.Returns the tip text for this property.Returns an enumeration describing the available options.static void
Main method for testing this class.Returns the tip text for this property.void
setKNN
(int knn) Sets the number of neighbours used for kernel bandwidth setting.void
setNearestNeighbourSearchAlgorithm
(NearestNeighbourSearch nearestNeighbourSearchAlgorithm) Sets the nearestNeighbourSearch algorithm to be used for finding nearest neighbour(s).void
setOptions
(String[] options) Parses a given list of options.void
setWeightingKernel
(int kernel) Sets the kernel weighting method to use.toString()
Returns a description of this classifier.void
updateClassifier
(Instance instance) Adds the supplied instance to the training set.Returns the tip text for this property.从类继承的方法 weka.classifiers.SingleClassifierEnhancer
classifierTipText, getClassifier, setClassifier
从类继承的方法 weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
-
构造器详细资料
-
LWL
public LWL()Constructor.
-
-
方法详细资料
-
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
-
enumerateMeasures
Returns an enumeration of the additional measure names produced by the neighbour search algorithm.- 返回:
- an enumeration of the measure names
-
getMeasure
Returns the value of the named measure from the neighbour search algorithm.- 参数:
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
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中SingleClassifierEnhancer
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-A The nearest neighbour search algorithm to use (default: weka.core.neighboursearch.LinearNNSearch).
-K <number of neighbours> Set the number of neighbours used to set the kernel bandwidth. (default all)
-U <number of weighting method> Set the weighting kernel shape to use. 0=Linear, 1=Epanechnikov, 2=Tricube, 3=Inverse, 4=Gaussian. (default 0 = Linear)
-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.DecisionStump)
Options specific to classifier weka.classifiers.trees.DecisionStump:
-D If set, classifier is run in debug mode and may output additional info to the console
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中SingleClassifierEnhancer
- 参数:
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
在类中SingleClassifierEnhancer
- 返回:
- an array of strings suitable for passing to setOptions
-
KNNTipText
Returns the tip text for this property.- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setKNN
public void setKNN(int knn) Sets the number of neighbours used for kernel bandwidth setting. The bandwidth is taken as the distance to the kth neighbour.- 参数:
knn
- the number of neighbours included inside the kernel bandwidth, or 0 to specify using all neighbors.
-
getKNN
public int getKNN()Gets the number of neighbours used for kernel bandwidth setting. The bandwidth is taken as the distance to the kth neighbour.- 返回:
- the number of neighbours included inside the kernel bandwidth, or 0 for all neighbours
-
weightingKernelTipText
Returns the tip text for this property.- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setWeightingKernel
public void setWeightingKernel(int kernel) Sets the kernel weighting method to use. Must be one of LINEAR, EPANECHNIKOV, TRICUBE, INVERSE, GAUSS or CONSTANT, other values are ignored.- 参数:
kernel
- the new kernel method to use. Must be one of LINEAR, EPANECHNIKOV, TRICUBE, INVERSE, GAUSS or CONSTANT.
-
getWeightingKernel
public int getWeightingKernel()Gets the kernel weighting method to use.- 返回:
- the new kernel method to use. Will be one of LINEAR, EPANECHNIKOV, TRICUBE, INVERSE, GAUSS or CONSTANT.
-
nearestNeighbourSearchAlgorithmTipText
Returns the tip text for this property.- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNearestNeighbourSearchAlgorithm
Returns the current nearestNeighbourSearch algorithm in use.- 返回:
- the NearestNeighbourSearch algorithm currently in use.
-
setNearestNeighbourSearchAlgorithm
public void setNearestNeighbourSearchAlgorithm(NearestNeighbourSearch nearestNeighbourSearchAlgorithm) Sets the nearestNeighbourSearch algorithm to be used for finding nearest neighbour(s).- 参数:
nearestNeighbourSearchAlgorithm
- - The NearestNeighbourSearch class.
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中SingleClassifierEnhancer
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Generates the classifier.- 指定者:
buildClassifier
在类中Classifier
- 参数:
instances
- set of instances serving as training data- 抛出:
Exception
- if the classifier has not been generated successfully
-
updateClassifier
Adds the supplied instance to the training set.- 指定者:
updateClassifier
在接口中UpdateableClassifier
- 参数:
instance
- the instance to add- 抛出:
Exception
- if instance could not be incorporated successfully
-
distributionForInstance
Calculates the class membership probabilities for the given test instance.- 覆盖:
distributionForInstance
在类中Classifier
- 参数:
instance
- the instance to be classified- 返回:
- preedicted class probability distribution
- 抛出:
Exception
- if distribution can't be computed successfully
-
toString
Returns a description of this classifier. -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
argv
- the options
-