KNN Arguments - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™
OutputTable
[Optional] Specify the name of the output table.
Default behavior: The function displays the output to the screen.
K
Specify the number of nearest neighbors to use for classifying the test data.
ResponseColumn
Specify the name of the training table column that contains the class label or classification of the classified data objects.
IDColumn
Specify the name of the testing table column that uniquely identifies a data object.
DistanceFeatures
Specify the names of the training table columns that the function uses to compute the distance between a test object and the training objects. The test table must also have these columns.
VotingWeight
[Optional] Specify the voting weight of the distance between a test object and the training objects. The voting_weight must be a nonnegative integer.
The function calculates distance-weighted voting, w, with this equation:

w = 1/POWER(distance, voting_weight)

Where distance is the distance between the test object and the training object.
Default: 0
CustomizedDistance
[Optional] Specify the distance function. The parameter jar is the name of the JAR file that contains the distance metric class. The parameter distance_class is the distance metric class defined in the jar file. This JAR file must be installed on the ML Engine.
Default: Euclidean distance
The ML Engine does not support the creation of new customized distance classes. However, it does support existing JAR files—for installation instructions, see Teradata Vantage™ User Guide, B700-4002.
ForceMapReduce
[Optional] Specify whether to partition the training data. If you specify 'true', the KNN function partitions the training data and uses the map-and reduce function.
Default: 'false' (The function loads all training data into memory and uses only the row function.)
PartitionBlockSize
[Optional] Specify the partition block size to use with ForceMapReduce ('true'). Specifying an optimal value for this argument may improve performance. The optimal value depends on the size of the training data and the vworker configuration. Because rows in a partition are processed together, a higher value improves performance, but the maximum value is limited by the memory of the vworker. For example, if the training data set has 1024 rows, specifying PartitionBlockSize('16') partitions the input data into 64 partitions of 16 rows each. Similarly, PartitionBlockSize('128') creates 8 (1024/128) partitions of 128 rows each. The partitions are distributed evenly across the number of vworkers available.