7.00.02 - Prediction Accuracy - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Release Date
September 2017
Content Type
Programming Reference
User Guide
Publication ID
B700-1022-700K
Language
English (United States)

The prediction accuracy (proportion of correct predictions) of 93.33% is obtained using the following SQL statements:

DROP TABLE IF EXISTS nb_predict_accuracy;

CREATE TABLE nb_predict_accuracy DISTRIBUTE BY hash(id) AS
  SELECT nb_iris_input_test.id, species, prediction
    FROM nb_iris_predict, nb_iris_input_test
      WHERE nb_iris_input_test.id = nb_iris_predict.id;

  SELECT (SELECT count(id) FROM nb_predict_accuracy
    WHERE prediction = species)/(SELECT count(id)
    FROM nb_predict_accuracy) AS prediction_accuracy;
Naive Bayes Example: Prediction Accuracy
prediction_accuracy
0.93333333333333333333