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

Class weka.classifiers.rules.Nnge

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.rules.Nnge

public class Nnge
extends Classifier
implements UpdateableClassifier, OptionHandler
Nnge classifier. Nearest neighbor like algorithm using non-nested generalized exemplars. For more information, see

Brent Martin, (1995) "Instance-Based learning : Nearest Neighbor With Generalization", Master Thesis, University of Waikato, Hamilton, New Zealand

Sylvain Roy (2002) "Nearest Neighbor With Generalization", Unpublished, University of Canterbury, Christchurch, New Zealand

Valid options are:

-I num
Set the number of folder to use in the computing of the mutual information (default 5)

-G num
Set the number of attempts of generalisation (default 5)

Version:
$$
Author:
Brent Martin (bim20@cosc.canterbury.ac.nz)
Author:
Sylvain Roy (sro33@student.canterbury.ac.nz)

Constructor Index

 o Nnge()
 

Method Index

 o buildClassifier(Instances)
Generates a classifier.
 o classifyInstance(Instance)
Classifies a given instance.
 o getNumAttemptsOfGeneOption()
Gets the number of attempts for generalisation.
 o getNumFoldersMIOption()
Gets the number of folder for mutual information.
 o getOptions()
Gets the current option settings for the OptionHandler.
 o listOptions()
Returns an enumeration of all the available options..
 o main(String[])
Main method for testing this class.
 o setNumAttemptsOfGeneOption(int)
Sets the number of attempts for generalisation.
 o setNumFoldersMIOption(int)
Sets the number of folder for mutual information.
 o setOptions(String[])
Sets the OptionHandler's options using the given list.
 o toString()
Returns a description of this classifier.
 o updateClassifier(Instance)
Updates the classifier using the given instance.

Constructor Detail

 o Nnge
public Nnge()

Method Detail

 o buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
          Generates a classifier. Must initialize all fields of the classifier that are not being set via options (ie. multiple calls of buildClassifier must always lead to the same result). Must not change the dataset in any way.
Parameters:
data - 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 classifyInstance
public double classifyInstance(Instance instance) throws java.lang.Exception
          Classifies a given instance.
Parameters:
instance - the instance to be classified
Returns:
index of the predicted class as a double
Throws:
java.lang.Exception - if instance could not be classified successfully
Overrides:
classifyInstance in class Classifier
 o updateClassifier
public void updateClassifier(Instance instance) throws java.lang.Exception
          Updates the classifier using the given instance.
Parameters:
instance - the instance to include
Throws:
java.lang.Exception - if instance could not be incorporated successfully
 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 listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration of all the available options..
Returns:
an enumeration of all available options.
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).
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 option settings for the OptionHandler.
Returns:
the list of current option settings as an array of strings
 o getNumAttemptsOfGeneOption
public int getNumAttemptsOfGeneOption()
          Gets the number of attempts for generalisation.
Returns:
the value of the option G
 o setNumAttemptsOfGeneOption
public void setNumAttemptsOfGeneOption(int newIntParameter)
          Sets the number of attempts for generalisation.
Parameters:
newIntParameter - the new value.
 o getNumFoldersMIOption
public int getNumFoldersMIOption()
          Gets the number of folder for mutual information.
Returns:
the value of the option I
 o setNumFoldersMIOption
public void setNumFoldersMIOption(int newIntParameter)
          Sets the number of folder for mutual information.
Parameters:
newIntParameter - the new value.
 o main
public static void main(java.lang.String argv[])
          Main method for testing this class.
Parameters:
argv - should contain command line arguments for evaluation (see Evaluation).

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