Prediction Accuracy - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Published
September 2017
Language
English (United States)
Last Update
2018-04-17
dita:mapPath
uce1497542673292.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1022
lifecycle
previous
Product Category
Software

The following SQL code calculates and displays the prediction accuracy.

DROP TABLE IF EXISTS st_predict_accuracy;

CREATE TABLE st_predict_accuracy DISTRIBUTE BY hash(pid) AS
  SELECT pid, pred_label :: INTEGER AS pred_label,species FROM     singletree_predict, iris_test WHERE id = pid;

  SELECT (SELECT COUNT(pid) FROM st_predict_accuracy
    WHERE pred_label = species)/(SELECT COUNT(pid)
    FROM st_predict_accuracy) AS prediction_accuracy;
Single_Tree_Predict Example Prediction Accuracy
prediction_accuracy
0.90000000000000000000