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%.