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.
|
String[] |
getOptions()
Gets the current option settings for the OptionHandler.
|
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.
|
String |
globalInfo()
Returns a string describing classifier
|
Enumeration |
listOptions()
Returns an enumeration of all the available options..
|
static void |
main(String[] argv)
Main method for testing this class.
|
String |
numAttemptsOfGeneOptionTipText()
Returns the tip text for this property
|
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(String[] options)
Sets the OptionHandler's options using the given list.
|
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 String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ClassifierCapabilitiespublic void buildClassifier(Instances data) throws Exception
buildClassifier in class Classifierdata - set of instances serving as training dataException - if the classifier has not been
generated successfullypublic double classifyInstance(Instance instance) throws Exception
classifyInstance in class Classifierinstance - the instance to be classifiedException - if instance could not be classified
successfullypublic void updateClassifier(Instance instance) throws Exception
updateClassifier in interface UpdateableClassifierinstance - the instance to includeException - if instance could not be incorporated
successfullypublic String toString()
public Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class Classifierpublic void setOptions(String[] options) throws 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 stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Classifierpublic String numAttemptsOfGeneOptionTipText()
public int getNumAttemptsOfGeneOption()
public void setNumAttemptsOfGeneOption(int newIntParameter)
newIntParameter - the new value.public String numFoldersMIOptionTipText()
public int getNumFoldersMIOption()
public void setNumFoldersMIOption(int newIntParameter)
newIntParameter - the new value.public String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(String[] argv)
argv - should contain command line arguments for evaluation
(see Evaluation).Copyright © 2021 University of Waikato, Hamilton, NZ. All rights reserved.