Calculating Prediction Accuracy - Aster Analytics

Teradata Aster Analytics Foundation User Guide

Product
Aster Analytics
Release Number
6.21
Published
November 2016
Language
English (United States)
Last Update
2018-04-14
dita:mapPath
kiu1466024880662.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1021
lifecycle
previous
Product Category
Software

For a classification problem, you can calculate the prediction accuracy, or misclassification error. Because the NeuralNet function prediction is numeric, you must first transform the numeric values in the predictOut_0 column into classes. For example, if predictOut_0 > 3, the predicted class is 4.

For the transformation, use these statements:

UPDATE nn_bc_predict SET "predictOut_0" = 2 WHERE "predictOut_0" < 3;
UPDATE nn_bc_predict SET "predictOut_0" = 4 WHERE "predictOut_0" > 3;

To display the number of correct classifications, use this query:

SELECT count(*) FROM nn_bc_predict WHERE "predictOut_0" = class;

The result is:

count(1) 
----------
205
(1 row)

To display the total number of classifications, use this query:

SELECT count(*) FROM nn_bc_predict;

The result is:

count(1) 
----------
210
(1 row)

The prediction accuracy is 205/210 = 97.6%.