Accuracy

If you want to calculate the accuracy with cross-validation, check out this.

Imports

from sklearn.metrics import accuracy_score

Create data

y_true = [0, 1, 2, 3, 4]
y_pred = [0, 2, 1, 3, 5]

Calculate accuracy

accuracy_score(y_true, y_pred)
0.4