calculate the proportion of correct predictions by dividing the number of correct predictions by the total number of predictions. store the result in a variable called accuracy. in matlab

Assuming num_correct_predictions and total_predictions are already calculated, you can compute the accuracy in MATLAB as follows:

main.m
accuracy = num_correct_predictions / total_predictions;
56 chars
2 lines

Make sure that num_correct_predictions and total_predictions are of numeric data types (e.g. double, int, etc.) and not string types.

related categories

gistlibby LogSnag