Package rdkit :: 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, radius=None)
x.__init__(...) initializes x; see help(type(x)) 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, neighborList=None)
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__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, k, attrs, dfunc, radius=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

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

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

  - weightedAverage: if provided, the neighbors' contributions to the value will be
                     weighed by their reciprocal square distance

  - neighborList: if provided, will be used to return the list of neighbors

**Returns**

  - the classification of _example_