KNN Example: OutputProb ('true'), Responses Omitted | Teradata Vantage - KNN Example: OutputProb ('true'), Responses Omitted - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

SQL Call

SELECT * FROM KNN (
  ON computers_train1_clustered AS TrainingData
  ON computers_test1 AS TestData
  OUT TABLE OutputTable (knn_output_1)
  USING
  K (50)
  ResponseColumn ('computer_category')
  TargetColumns ('price','speed','hd','ram','screen')
  VotingWeight (1)
  TestIDColumn ('id')
  OutputProb ('t')
) AS dt ;

Output

This query returns the following table:

SELECT * FROM knn_output_1;
         id  prediction                              prob
-----------  --------------------  ----------------------
         91  hyper                  1.00000000000000E 000
         93  mega                   1.00000000000000E 000
        112  super                  1.00000000000000E 000
        122  super                  1.00000000000000E 000
        135  special                6.57223859017317E-001
        153  uber                   1.00000000000000E 000
        199  super                  1.00000000000000E 000
        209  mega                   9.68588381270587E-001