sklearn_pmml_model.neighbors._base#

Module Contents#

Classes#

PMMLBaseKNN

Abstract class for k-nearest neighbor models.

class sklearn_pmml_model.neighbors._base.PMMLBaseKNN(leaf_size=30)#

Abstract class for k-nearest neighbor models.

The PMML model consists out of a <NearestNeighborModel> element, containing a <SupportVectorMachine> element that contains a <SupportVectors> element describing support vectors, and a <TrainingInstances> element that describes the training data points, a <ComparisonMeasure> element describing the distance metric used, and a <KNNInputs> element describing which features are considered when calculating distance. k is indicated using the numberOfNeighbors attribute on the <NearestNeighborModel> element.

Parameters:
leaf_sizeint, default=30

Leaf size passed to BallTree or KDTree. This can affect the speed of the construction and query, as well as the memory required to store the tree. The optimal value depends on the nature of the problem.

Notes

Specification: http://dmg.org/pmml/v4-3/KNN.html