public class NNge extends Classifier implements UpdateableClassifier, OptionHandler, TechnicalInformationHandler
@mastersthesis{Martin1995,
address = {Hamilton, New Zealand},
author = {Brent Martin},
school = {University of Waikato},
title = {Instance-Based learning: Nearest Neighbor With Generalization},
year = {1995}
}
@unpublished{Roy2002,
address = {Christchurch, New Zealand},
author = {Sylvain Roy},
school = {University of Canterbury},
title = {Nearest Neighbor With Generalization},
year = {2002}
}
Valid options are:
-G <value> Number of attempts of generalisation.
-I <value> Number of folder for computing the mutual information.
| Constructor and Description |
|---|
NNge() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildClassifier(Instances data)
Generates a classifier.
|
double |
classifyInstance(Instance instance)
Classifies a given instance.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
int |
getNumAttemptsOfGeneOption()
Gets the number of attempts for generalisation.
|
int |
getNumFoldersMIOption()
Gets the number of folder for mutual information.
|
java.lang.String[] |
getOptions()
Gets the current option settings for the OptionHandler.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
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.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.util.Enumeration |
listOptions()
Returns an enumeration of all the available options..
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
numAttemptsOfGeneOptionTipText()
Returns the tip text for this property
|
java.lang.String |
numFoldersMIOptionTipText()
Returns the tip text for this property
|
void |
setNumAttemptsOfGeneOption(int newIntParameter)
Sets the number of attempts for generalisation.
|
void |
setNumFoldersMIOption(int newIntParameter)
Sets the number of folder for mutual information.
|
void |
setOptions(java.lang.String[] options)
Sets the OptionHandler's options using the given list.
|
java.lang.String |
toString()
Returns a description of this classifier.
|
void |
updateClassifier(Instance instance)
Updates the classifier using the given instance.
|
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebugpublic java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ClassifierCapabilitiespublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier in class Classifierdata - set of instances serving as training datajava.lang.Exception - if the classifier has not been
generated successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance in class Classifierinstance - the instance to be classifiedjava.lang.Exception - if instance could not be classified
successfullypublic void updateClassifier(Instance instance) throws java.lang.Exception
updateClassifier in interface UpdateableClassifierinstance - the instance to includejava.lang.Exception - if instance could not be incorporated
successfullypublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class Classifierpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-G <value> Number of attempts of generalisation.
-I <value> Number of folder for computing the mutual information.
setOptions in interface OptionHandlersetOptions in class Classifieroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Classifierpublic java.lang.String numAttemptsOfGeneOptionTipText()
public int getNumAttemptsOfGeneOption()
public void setNumAttemptsOfGeneOption(int newIntParameter)
newIntParameter - the new value.public java.lang.String numFoldersMIOptionTipText()
public int getNumFoldersMIOption()
public void setNumFoldersMIOption(int newIntParameter)
newIntParameter - the new value.public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(java.lang.String[] argv)
argv - should contain command line arguments for evaluation
(see Evaluation).