Skip to content

Instantly share code, notes, and snippets.

@Guidosalimbeni
Created January 7, 2021 21:35
Show Gist options
  • Save Guidosalimbeni/fab41a9b6c76e2f66b804eb1a0e9028d to your computer and use it in GitHub Desktop.
Save Guidosalimbeni/fab41a9b6c76e2f66b804eb1a0e9028d to your computer and use it in GitHub Desktop.
def getAccuracy(testSet, predictions):
correct = 0
for x in range(len(testSet)):
if testSet[x][-1] == predictions[x]:
correct += 1
return (correct/float(len(testSet))) * 100.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment