logo
Loading...

KF與cross_val_score的差異 - Cupoy

想請問您兩個問題1. KF 跟 cross_val_score的差異2.在範例中kf.split(X...

ml100-2,ml100-2-d34

KF與cross_val_score的差異

2019/05/25 03:22 AM
機器學習新手論壇
許丕敏
觀看數:0
回答數:2
收藏數:0
ml100-2
ml100-2-d34

想請問您兩個問題

1. KF 跟 cross_val_score的差異

2.在範例中kf.split(X)並無輸入Y,為何會有Y_test的output

 

kf = KFold(n_splits=5)

i = 0

for train_index, test_index in kf.split(X):

    i +=1 

    X_train, X_test = X[train_index], X[test_index]

    y_train, y_test = y[train_index], y[test_index]

    print("FOLD {}: ".format(i))

    print("X_test: ", X_test)

    print("Y_test: ", y_test)

    print("-"*30)