Classification Workflow: repeated n-fold cross-validation?
In the Classification Workflow, when selecting cross-validation with n-folds, the classification is performed using n-1 groups as training and predicting the remaining group, but is this performed only once? or several n-folded partitions are tried? In that case, how many? The usual way is repeating i.e. 10x for a 10-fold partition.
Comments (6)
-
-
reporter so I understand
RepeatedKFold(n_splits=10, n_repeats=10, random_state=random_state)
-
No, internally the cross_val_predict function is used: https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.cross_val_predict.html
-
reporter So it would just be (for 10-fold):
cross_val_predict(model, X, y, cv=10)
?
Actually, how could I just check this myself? Is there a way to know which specific *.py files are used by a given process (eg. Cross-validation Accuracy Assessment in Classification workflow).
-
For external users, I would guess that it is not really easy to find the specific lines of code related to a specific functionality. What you are looking for is located here:
-
- changed status to resolved
- Log in to comment
It’s done n times. Each time, one of the n partitions is hold out and class labels are predicted. In the end we have an indipendent prediction for all samples in the dataset.