Package moa.classifiers.lazy
Class kNNwithPAW
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.AbstractClassifier
-
- moa.classifiers.lazy.kNN
-
- moa.classifiers.lazy.kNNwithPAW
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,Classifier
,MultiClassClassifier
,Regressor
,AWTRenderable
,Learner<Example<Instance>>
,MOAObject
,OptionHandler
public class kNNwithPAW extends kNN implements MultiClassClassifier
k Nearest Neighbor ADAPTIVE with PAW.Valid options are:
-k number of neighbours
- Version:
- 03.2012
- Author:
- Jesse Read (jesse@tsc.uc3m.es)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
marker
protected double
prob
-
Fields inherited from class moa.classifiers.lazy.kNN
kOption, limitOption, medianOption, nearestNeighbourSearchOption, window
-
Fields inherited from class moa.classifiers.AbstractClassifier
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description kNNwithPAW()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
getModelDescription(StringBuilder out, int indent)
Returns a string representation of the model.String
getPurposeString()
Dictionary with option texts and objectsboolean
isRandomizable()
Gets whether this learner needs a random seed.void
resetLearningImpl()
Resets this classifier.void
trainOnInstanceImpl(Instance inst)
Trains this classifier incrementally using the given instance.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods.-
Methods inherited from class moa.classifiers.lazy.kNN
getModelMeasurementsImpl, getVotesForInstance, setModelContext
-
Methods inherited from class moa.classifiers.AbstractClassifier
contextIsCompatible, copy, correctlyClassifies, defineImmutableCapabilities, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getSubClassifiers, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance, trainOnInstance
-
Methods inherited from class moa.options.AbstractOptionHandler
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Method Detail
-
getPurposeString
public String getPurposeString()
Description copied from class:AbstractOptionHandler
Dictionary with option texts and objects- Specified by:
getPurposeString
in interfaceOptionHandler
- Overrides:
getPurposeString
in classkNN
- Returns:
- the string with the purpose of this object
-
resetLearningImpl
public void resetLearningImpl()
Description copied from class:AbstractClassifier
Resets this classifier. It must be similar to starting a new classifier from scratch.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.- Overrides:
resetLearningImpl
in classkNN
-
trainOnInstanceImpl
public void trainOnInstanceImpl(Instance inst)
Description copied from class:AbstractClassifier
Trains this classifier incrementally using the given instance.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.- Overrides:
trainOnInstanceImpl
in classkNN
- Parameters:
inst
- the instance to be used for training
-
getModelDescription
public void getModelDescription(StringBuilder out, int indent)
Description copied from class:AbstractClassifier
Returns a string representation of the model.- Overrides:
getModelDescription
in classkNN
- Parameters:
out
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
isRandomizable
public boolean isRandomizable()
Description copied from interface:Learner
Gets whether this learner needs a random seed. Examples of methods that needs a random seed are bagging and boosting.- Specified by:
isRandomizable
in interfaceLearner<Example<Instance>>
- Overrides:
isRandomizable
in classkNN
- Returns:
- true if the learner needs a random seed.
-
-