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