rdkit.ML.KNN.KNNRegressionModel module — The RDKit 2016.09.1 documentation

# rdkit.ML.KNN.KNNRegressionModel module

Define the class _KNNRegressionModel_, used to represent a k-nearest neighbhors regression model

> Inherits from _KNNModel_

class `rdkit.ML.KNN.KNNRegressionModel.` `KNNRegressionModel`(k, attrs, dfunc, radius=None)

  Bases: `rdkit.ML.KNN.KNNModel.KNNModel`

  This is used to represent a k-nearest neighbor classifier

  `GetBadExamples`()
  `NameModel`(varNames)
  `PredictExample`(example, appendExamples=0, weightedAverage=0, neighborList=None)

    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_

  `SetBadExamples`(examples)
  `type`()