Computer scienceData scienceInstrumentsScikit-learnMachine Learning with scikit-learn

Cross-validation in scikit-learn

Train index

Report a typo

Note that this task assumes scikit-learn version 1.2.2

You have the following starter code:

from sklearn.datasets import make_classification
from sklearn.model_selection import StratifiedKFold

X, y = make_classification(n_samples=100, n_features=5, random_state=42)

Use 4-fold StratifiedKFold to split the data. The answer should contain a Python list of train indexes for the second (starting from 1) cross-validation split and has to be provided as follows:

[idx_1, idx_2, ...]
Enter a short text
___

Create a free account to access the full topic