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;
prediction_accuracy |
---|
0.90000000000000000000 |