|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.DistributionClassifier | +--weka.classifiers.kstar.KStar
K* is an instance-based classifier, that is the class of a test instance is based upon the class of those training instances similar to it, as determined by some similarity function. The underlying assumption of instance-based classifiers such as K*, IB1, PEBLS, etc, is that similar instances will have similar classes. For more information on K*, see
John, G. Cleary and Leonard, E. Trigg (1995) "K*: An Instance- based Learner Using an Entropic Distance Measure", Proceedings of the 12th International Conference on Machine learning, pp. 108-114.
Field Summary | |
protected int |
m_BlendMethod
0 = use specified blend, 1 = entropic blend setting |
protected KStarCache[] |
m_Cache
A custom data structure for caching distinct attribute values and their scale factor or stop parameter. |
protected int |
m_ClassType
The class attribute type |
protected int |
m_ComputeRandomCols
Flag turning on and off the computation of random class colomns |
protected int |
m_GlobalBlend
default sphere of influence blend setting |
protected int |
m_InitFlag
Flag turning on and off the initialisation of config variables |
protected int |
m_MissingMode
missing value treatment |
protected int |
m_NumAttributes
The number of attributes |
protected int |
m_NumClasses
The number of class values |
protected int |
m_NumInstances
The number of instances in the dataset |
protected int[][] |
m_RandClassCols
Table of random class value colomns |
protected Instances |
m_Train
The training instances used for classification. |
static Tag[] |
TAGS_MISSING
Define possible missing value handling methods |
Fields inherited from interface weka.classifiers.kstar.KStarConstants |
B_ENTROPY, B_SPHERE, EPSILON, FLOOR, FLOOR1, INITIAL_STEP, LOG2, M_AVERAGE, M_DELETE, M_MAXDIFF, M_NORMAL, NUM_RAND_COLS, OFF, ON, ROOT_FINDER_ACCURACY, ROOT_FINDER_MAX_ITER |
Constructor Summary | |
KStar()
|
Method Summary | |
void |
buildClassifier(Instances instances)
Generates the classifier. |
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance. |
boolean |
getEntropicAutoBlend()
Get whether entropic blending being used |
int |
getGlobalBlend()
Get the value of the global blend parameter |
SelectedTag |
getMissingMode()
Gets the method to use for handling missing values. |
java.lang.String[] |
getOptions()
Gets the current settings of K*. |
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 |
setEntropicAutoBlend(boolean e)
Set whether entropic blending is to be used. |
void |
setGlobalBlend(int b)
Set the global blend parameter |
void |
setMissingMode(SelectedTag newMode)
Sets the method to use for handling missing values. |
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)
Adds the supplied instance to the training set |
Methods inherited from class weka.classifiers.DistributionClassifier |
classifyInstance |
Methods inherited from class weka.classifiers.Classifier |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Instances m_Train
protected int m_NumInstances
protected int m_NumClasses
protected int m_NumAttributes
protected int m_ClassType
protected int[][] m_RandClassCols
protected int m_ComputeRandomCols
protected int m_InitFlag
protected KStarCache[] m_Cache
protected int m_MissingMode
protected int m_BlendMethod
protected int m_GlobalBlend
public static final Tag[] TAGS_MISSING
Constructor Detail |
public KStar()
Method Detail |
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training datajava.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 addjava.lang.Exception
- if instance could not be incorporated successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class DistributionClassifier
instance
- the instance to be classifiedjava.lang.Exception
- if an error occurred during the predictionpublic SelectedTag getMissingMode()
public void setMissingMode(SelectedTag newMode)
newMode
- the method to use for handling missing values.public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setGlobalBlend(int b)
b
- the value for global blendingpublic int getGlobalBlend()
public void setEntropicAutoBlend(boolean e)
e
- true if entropic blending is to be usedpublic boolean getEntropicAutoBlend()
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
argv
- should contain command line options (see setOptions)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |