Skip to content

Instantly share code, notes, and snippets.

@z1nc0r3
Last active September 5, 2023 23:28
Show Gist options
  • Save z1nc0r3/358290df55514ca814c495dc003419c8 to your computer and use it in GitHub Desktop.
Save z1nc0r3/358290df55514ca814c495dc003419c8 to your computer and use it in GitHub Desktop.
Winner Takes All algorithm using Matlab
function accuracy = WinnerTakesAll(actual, predict, class)
[m, n] = size(actual);
[maxP, classP] = max(predict, [], 2);
accuracy = 100 * sum(actual(:, n) == class(classP)') / m;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment