Optional Syntax Elements for TD_KNN - 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-04-06
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢
ModelType
Specifies the model type for the KNN function.
Accepted Values: Regression, Classification, or Neighbors.
Default Value: Classification
K
Specifies the number of nearest neighbors to use in the algorithm. Select any positive integer value greater than 0 or less than or equal to 100.
Default Value: 5
Accumulate
Specifies the test table column names to copy to the output table.
ResponseColumn
[For the Regression or Classification model type] Specifies the training table column name that contains the numeric response variable values used for prediction in KNN-based regression or classification.
The class labels under the Response column must be numeric.
Invalid for the Neighbors model type.
VotingWeight
[For the Regression or Classification model type] Specifies the voting weight of the training object to determine the test object class as a function of the distance between the training and the test object.
The weighted voting score is calculated as w=1/power(distance, voting_weight), where distance is the distance between the test object and the training object. The voting_weight value must be a non-negative real number.
Default Value: 0
Tolerance
Specifies the tolerance value to define the smallest distance.
The weight (w=1/POWER(distance, voting_weight)) is undefined if the distance is zero and a non-zero voting_weight is used.
For any distance less than the specified tolerance, the weight is calculated as w=1/POWER(tolerance, voting_weight).
Default Value: 0.0000001
OutputProb
[For the Classification model type] Specifies whether you want to return the probability of each response specified in the Responses argument. If the Responses argument is not specified, then the function returns the probability of the predicted response when it is set to True.
Default Value: False
Invalid for the Regression or the Neighbors model type
Responses
[When the OutputProb argument is true] Specifies the class labels for returning probabilities. The class labels are transformed to integer values only.
The maximum value is 1000.
EmitNeighbors
[For the Classification or Regression model type] Specifies whether to display neighbors in the output. The default value is true for the Neighbors model type, or you can manually set the value to true. However, you cannot set the value to false for the Neighbors model type.
The default value for the Classification or the Regression model type is false.
EmitDistances
Specifies whether to display the neighbor distances in the output.
Default value: False