การตรวจสอบความถูกต้องในเครื่อง

การแข่งขัน Kaggle ด้วย Python

Yauhen Babakhin

Kaggle Grandmaster

แรงจูงใจ

ตัวอย่าง overfitting กับ Public และ Private leaderboard

การแข่งขัน Kaggle ด้วย Python

Holdout set

แผนผัง holdout set

การแข่งขัน Kaggle ด้วย Python

Holdout set

แผนผัง holdout set

การแข่งขัน Kaggle ด้วย Python

Holdout set

แผนผัง holdout set

การแข่งขัน Kaggle ด้วย Python

K-fold cross-validation

 

การแบ่งข้อมูล train เป็น 4 fold

การแข่งขัน Kaggle ด้วย Python

K-fold cross-validation

 

แผนผัง k-fold cross-validation

การแข่งขัน Kaggle ด้วย Python

K-fold cross-validation

# Import KFold
from sklearn.model_selection import KFold
# Create a KFold object
kf = KFold(n_splits=5, shuffle=True, random_state=123)
# Loop through each cross-validation split
for train_index, test_index in kf.split(train):

# Get training and testing data for the corresponding split cv_train, cv_test = train.iloc[train_index], train.iloc[test_index]
การแข่งขัน Kaggle ด้วย Python

Stratified K-fold

  แผนผัง stratified k-fold cross-validation

การแข่งขัน Kaggle ด้วย Python

Stratified K-fold

# Import StratifiedKFold
from sklearn.model_selection import StratifiedKFold

# Create a StratifiedKFold object str_kf = StratifiedKFold(n_splits=5, shuffle=True, random_state=123)
# Loop through each cross-validation split for train_index, test_index in str_kf.split(train, train['target']): cv_train, cv_test = train.iloc[train_index], train.iloc[test_index]
การแข่งขัน Kaggle ด้วย Python

มาฝึกกันเถอะ!

การแข่งขัน Kaggle ด้วย Python

Preparing Video For Download...