Python ile Bir Kaggle Yarışmasını Kazanmak
Yauhen Babakhin
Kaggle Grandmaster






# Import KFold
from sklearn.model_selection import KFold
# KFold nesnesi oluşturun
kf = KFold(n_splits=5, shuffle=True, random_state=123)
# Her çapraz doğrulama bölmesi için döngü for train_index, test_index in kf.split(train):# İlgili bölme için eğitim ve test verilerini alın cv_train, cv_test = train.iloc[train_index], train.iloc[test_index]

# Import StratifiedKFold from sklearn.model_selection import StratifiedKFold# StratifiedKFold nesnesi oluşturun str_kf = StratifiedKFold(n_splits=5, shuffle=True, random_state=123)# Her çapraz doğrulama bölmesi için döngü for train_index, test_index in str_kf.split(train, train['target']): cv_train, cv_test = train.iloc[train_index], train.iloc[test_index]
Python ile Bir Kaggle Yarışmasını Kazanmak