Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function score = f1Score(actual, prediction)
- precision = sum(actual & prediction) / sum(prediction);
- recall = sum(actual & prediction) / sum(actual);
- score = 2 * (precision * recall) / (precision + recall);
- if isnan(score)
- score = 0;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement