def split_kfold_r(y): skf = KFold(5) ilst = [] for tri, tei in skf.split(y): ilst.append((tri, tei)) return ilst