|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--probabilityMachine.VennProbabilityClassifier | +--probabilityMachine.vpm.VPMKNearestNeighbours
The VPM K-Nearest Neighbours algorithm. This particular implementation is embedded, meaning that the traditional algorithm has been altered slightly to adapt a method for generating taxonomies of the data using the nearest neighbour information. For more information, see
Self-calibrating Probability Forecasting, Paper Ref?, May 2003, Vladimir Vovk, Glen Shafer, Ilia Nouretdinov
Field Summary | |
static int |
CRUDE_NEAREST_NEIGHBOUR
|
static int |
OTHER
|
static Tag[] |
TAXONOMY_CHOICE
|
Constructor Summary | |
VPMKNearestNeighbours()
The amazing VPM K Nearest Neighbours classifier |
|
VPMKNearestNeighbours(int k)
The amazing VPM K Nearest Neighbours classifier |
Method Summary | |
void |
buildClassifier(Instances instances)
Generates the classifier. |
int |
getDebugEvery()
Reports whether the VPM is currently in debug mode (if not -1), and specifies how frequently to output message about VPM's progress on data. |
int |
getKNN()
Gets the number of neighbours the VPM learner will use. |
java.lang.String[] |
getOptions()
Gets the current settings of VPM. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
void |
setDebugEvery(int debug)
Set the VPM to debug its output, outputting its progress as it goes along. |
void |
setKNN(int k)
Set the number of neighbours the VPM learner is to use. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Returns a description of this classifier. |
void |
updateClassifier(Instance instance)
Updates the classifier. |
Matrix |
vennProbsForInstance(Instance instance)
Returns the Venn probability matrix for a given test instance. |
Methods inherited from class probabilityMachine.VennProbabilityClassifier |
classifyInstance, computeRowOfVPMMatrix, distributionForInstance, printArray, printArray, returnDistribution, returnUpperAndLowerProbability |
Methods inherited from class weka.classifiers.Classifier |
debugTipText, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CRUDE_NEAREST_NEIGHBOUR
public static final int OTHER
public static final Tag[] TAXONOMY_CHOICE
Constructor Detail |
public VPMKNearestNeighbours(int k)
k
- the number of nearest neighbors to use for predictionpublic VPMKNearestNeighbours()
Method Detail |
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training data
java.lang.Exception
- if the classifier has not been generated successfullypublic void updateClassifier(Instance instance) throws java.lang.Exception
updateClassifier
in interface UpdateableClassifier
instance
- the instance to be put into the classifier
java.lang.Exception
- if the instance could not be included successfullypublic void setKNN(int k)
k
- the number of neighbours.public int getKNN()
public void setDebugEvery(int debug)
public int getDebugEvery()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-K num
Set the number of nearest neighbors to use in prediction
(default 1)
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 Matrix vennProbsForInstance(Instance instance) throws java.lang.Exception
vennProbsForInstance
in class VennProbabilityClassifier
instance
- the instance to be classified
java.lang.Exception
- no training instancespublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
argv
- should contain command line arguments for evaluation
(see Evaluation).
|
|||||||||
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