I am using K-Fold cross validation from sklearn.model_selection for evaluating the performance of my model. K=10 and the K-fold cross-validation is set as:
kfcv=Kfold(n_splits=10, random_state=0, shuffle=True)
The result of the first fold is 70% while remaining 9 folds are 100%. I have set random state to another value (such as 50), the same problem.
Why is the high discrepancy only with the first fold? I have used 5 fold and the same problem with the first fold. I expect that other folds should also reflects a decrease since the division is random and I also set shuffle to be true.
Is there anything am doing wrongly? If not, what would be the likely explanation for this?
Thanks.
kfcv = KFold(n_splits=10, random_state=0, shuffle=True) for trn_idx, tst_idx in kfcv.split(data): x_train = data[trn_idx, y_train1 = target[trn_idx] x_test =data[tst_idx, y_test1 = target[tst_idx] – I.O Animasahun Mar 15 '19 at 12:20