All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.kstar.KStar

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.kstar.KStar

public class KStar
extends DistributionClassifier
implements KStarConstants, OptionHandler, UpdateableClassifier, WeightedInstancesHandler
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.

Version:
$Revision 1.0 $
Author:
Len Trigg (len@intelligenesis.net)
Author:
Abdelaziz Mahoui (am14@cs.waikato.ac.nz)

Variable Index

 o TAGS_MISSING
Define possible missing value handling methods

Constructor Index

 o KStar()
 

Method Index

 o buildClassifier(Instances)
Generates the classifier.
 o distributionForInstance(Instance)
Calculates the class membership probabilities for the given test instance.
 o getEntropicAutoBlend()
Get whether entropic blending being used
 o getGlobalBlend()
Get the value of the global blend parameter
 o getMissingMode()
Gets the method to use for handling missing values.
 o getOptions()
Gets the current settings of K*.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o setEntropicAutoBlend(boolean)
Set whether entropic blending is to be used.
 o setGlobalBlend(int)
Set the global blend parameter
 o setMissingMode(SelectedTag)
Sets the method to use for handling missing values.
 o setOptions(String[])
Parses a given list of options.
 o toString()
Returns a description of this classifier.
 o updateClassifier(Instance)
Adds the supplied instance to the training set

Field Detail

 o TAGS_MISSING
public static final Tag[] TAGS_MISSING
          Define possible missing value handling methods

Constructor Detail

 o KStar
public KStar()

Method Detail

 o buildClassifier
public void buildClassifier(Instances instances) throws java.lang.Exception
          Generates the classifier.
Parameters:
instances - set of instances serving as training data
Throws:
java.lang.Exception - if the classifier has not been generated successfully
Overrides:
buildClassifier in class Classifier
 o updateClassifier
public void updateClassifier(Instance instance) throws java.lang.Exception
          Adds the supplied instance to the training set
Parameters:
instance - the instance to add
Throws:
java.lang.Exception - if instance could not be incorporated successfully
 o distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
          Calculates the class membership probabilities for the given test instance.
Parameters:
instance - the instance to be classified
Returns:
predicted class probability distribution
Throws:
java.lang.Exception - if an error occurred during the prediction
Overrides:
distributionForInstance in class DistributionClassifier
 o getMissingMode
public SelectedTag getMissingMode()
          Gets the method to use for handling missing values. Will be one of M_NORMAL, M_AVERAGE, M_MAXDIFF or M_DELETE.
Returns:
the method used for handling missing values.
 o setMissingMode
public void setMissingMode(SelectedTag newMode)
          Sets the method to use for handling missing values. Values other than M_NORMAL, M_AVERAGE, M_MAXDIFF and M_DELETE will be ignored.
Parameters:
newMode - the method to use for handling missing values.
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setGlobalBlend
public void setGlobalBlend(int b)
          Set the global blend parameter
Parameters:
b - the value for global blending
 o getGlobalBlend
public int getGlobalBlend()
          Get the value of the global blend parameter
Returns:
the value of the global blend parameter
 o setEntropicAutoBlend
public void setEntropicAutoBlend(boolean e)
          Set whether entropic blending is to be used.
Parameters:
e - true if entropic blending is to be used
 o getEntropicAutoBlend
public boolean getEntropicAutoBlend()
          Get whether entropic blending being used
Returns:
true if entropic blending is used
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are: ...
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of K*.
Returns:
an array of strings suitable for passing to setOptions()
 o toString
public java.lang.String toString()
          Returns a description of this classifier.
Returns:
a description of this classifier as a string.
Overrides:
toString in class java.lang.Object
 o main
public static void main(java.lang.String argv[])
          Main method for testing this class.
Parameters:
argv - should contain command line options (see setOptions)

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home