// Compute the prediction accuracy for the different folds (i.e. session)
cv_scores = []
for train, test in cv:
anova_svc.fit(X[train], y[train])
y_pred = anova_svc.predict(X[test])
cv_scores.append(np.sum(y_pred == y[test]) / float(np.size(y[test])))
// Return the corresponding mean prediction accuracy
After Change
cv = LeaveOneLabelOut(session // 2)
// Compute the prediction accuracy for the different folds (i.e. session)
cv_scores = cross_val_score(anova_svc, X, y)
// Return the corresponding mean prediction accuracy
classification_accuracy = np.mean(cv_scores)