TD_KNN Syntax | kNN | Teradata Vantage - TD_KNN Syntax - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢
TD_KNN(
    ON { table | view | (query) } AS TestTable PARTITION BY ANY
    ON { table | view | (query) } AS TrainingTable DIMENSION
    USING
    IDColumn('id_col_name')
    InputColumns({'target_column'| target_column_range}[...])
    [ModelType('classification'|'regression'|'neighbors')]
    [K(k)]
    [Accumulate({'accumulate_column'|accumulate_column_range}[,...])]
    [ResponseColumn(['response_column'])]
    [VotingWeight(voting_weight)]
    [Tolerance(tolerance)]
    [OutputProb('true'|'false'|'t'|'yes'|'y'|'1'|'f'|'no'|'n'|'0')]
    [Responses('response_list')]
    [EmitNeighbors('true'|'false'|'t'|'yes'|'y'|'1'|'f'|'no'|'n'|'0')]
    [EmitDistances('true'|'false'|'t'|'yes'|'y'|'1'|'f'|'no'|'n'|'0')]
) AS dt;
You can call this function from:
  • The FROM clause of a SELECT statement
  • As part of a CREATE TABLE statement
  • As part of a CREATE VIEW statement