Package ML :: Package KNN :: Module KNNRegressionModel :: Class KNNRegressionModel
[hide private]
[frames] | no frames]

Class KNNRegressionModel

source code

       object --+    
                |    
KNNModel.KNNModel --+
                    |
                   KNNRegressionModel

This is used to represent a k-nearest neighbor classifier

  



Instance Methods [hide private]
 
__init__(self, k, attrs, dfunc)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
type(self) source code
 
SetBadExamples(self, examples) source code
 
GetBadExamples(self) source code
 
NameModel(self, varNames) source code
 
PredictExample(self, example, appendExamples=0, weightedAverage=0)
Generates a prediction for an example by looking at its closest neighbors...
source code

Inherited from KNNModel.KNNModel: GetExamples, GetName, GetNeighbors, GetTestExamples, GetTrainingExamples, SetExamples, SetName, SetTestExamples, SetTrainingExamples

Inherited from KNNModel.KNNModel (private): _setup

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, k, attrs, dfunc)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: KNNModel.KNNModel.__init__

PredictExample(self, example, appendExamples=0, weightedAverage=0)

source code 
Generates a prediction for an example by looking at its closest neighbors

**Arguments**

  - examples: the example to be classified

  - appendExamples: if this is nonzero then the example will be stored on this model

**Returns**

  - the classification of _example_