I am training a model to solve binary classification problem usign scikitlearn, and i wish to perform cross validation with 5 folds.
As metrics, i would like to get both the average accuracy and a confusion matrix over the 5 folds.
So, using cross_validate i can pass multiple metrics to the scoring parameter.
According to this link, i can def a function that returns the confusion matrix at each fold. In that piece of code, it uses X to predict some output through .predict(X). But shouldn't a test set, x_test, have been used instead? And since, at each fold, a different test set is obtained from cross_validate, i don't understand how we can just pass X to both confusion_matrix_scorer() and .predict(). Other question, is clf = svm here, right?