TD_KNN Input - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-04-01
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

The function accepts only two ON clauses for input tables, where the Test table uses the PARTITION BY ANY clause, and the training table uses the dimension clause. Both the test and training tables are required.

TrainingTable Schema

Column Data Type Description
IDColumn BYTEINT,SMALLINT,INTEGER,BIGINT The unique identifier of the training table.
InputColumns NUMERIC The columns that the function uses to compute the distance between test data points and the training data points. The test table must have corresponding columns in the training table with name and datatype.
ResponseColumn NUMERIC (regression), INTEGER (classification) The numeric value of the target variable used for prediction in KNN-based regression or classification.

TestTable Schema

Column Data Type Description
IDColumn BYTEINT,SMALLINT,INTEGER,BIGINT The unique identifier of the test data object.
InputColumns NUMERIC The columns that the function uses to compute the distance between test data points and the training data points. The training table must have corresponding columns in the test table with name and datatype.