Developer Guide for Intel® Data Analytics Acceleration Library 2018 Update 3

Batch Processing

kNN classification follows the general workflow described in Usage Model: Training and Prediction.

Training

For a description of the input and output, refer to Usage Model: Training and Prediction.

At the training stage, K-D tree based kNN classifier has the following parameters:

Parameter

Default Value

Description

algorithmFPType

float

The floating-point type that the algorithm uses for intermediate computations. Can be float or double.

method

defaultDense

The computation method used by the K-D tree based kNN classification. The only training method supported so far is the default dense method.

DEPRECATED: seed

777

Note

This parameter is deprecated and will be removed in a future release.

The seed for random number generators, which are used internally to perform sampling needed to choose dimensions and cut-points for the K-D tree.

dataUseInModel

doNotUse

A parameter to enable/disable use of the input data set in the kNN model. Possible values:

  • doNotUse - the algorithm does not include the input data and labels in the trained kNN model but creates a copy of the input data set.
  • doUse - the algorithm includes the input data and labels in the trained kNN model.

The algorithm reorders feature vectors and corresponding labels in the input data set or its copy to improve performance at the prediction stage.

If the value is doUse, do not deallocate the memory for input data and labels.

engine

SharePtr< engines:: mt19937:: Batch>()

Pointer to the random number generator engine that is used internally to perform sampling needed to choose dimensions and cut-points for the K-D tree.

Prediction

For a description of the input and output, refer to Usage Model: Training and Prediction.

At the prediction stage, K-D tree based kNN classifier has the following parameters:

Parameter

Default Value

Description

algorithmFPType

float

The floating-point type that the algorithm uses for intermediate computations. Can be float or double.

method

defaultDense

The computation method used by the K-D tree based kNN classification. The only prediction method supported so far is the default dense method.

k

1

The number of neighbors.

Examples

C++: kdtree_knn_dense_batch.cpp

Java*: KDTreeKNNDenseBatch.java

Python*: kdtree_knn_dense_batch.py

See Also