Validasi Model di Python
Kasey Jones
Data Scientist

| Dataset | Definisi |
|---|---|
| Train | Sampel data untuk melatih model |
| Test (holdout) | Sampel data untuk menilai kinerja model |
Contoh rasio
import pandas as pd
tic_tac_toe = pd.read_csv("tic-tac-toe.csv")
X = pd.get_dummies(tic_tac_toe.iloc[:,0:9])
y = tic_tac_toe.iloc[:, 9]
Kursus Python tentang variabel dummy:
X_train, X_test, y_train, y_test =\
train_test_split(X, y, test_size=0.2, random_state=1111)
Parameter:
test_sizetrain_sizerandom_stateApa yang dilakukan saat menguji parameter model berbeda?

X_temp, X_test, y_temp, y_test =\
train_test_split(X, y, test_size=0.2, random_state=1111)
X_train, X_val, y_train, y_val =\
train_test_split(X_temp, y_temp, test_size=0.25, random_state=11111)
Validasi Model di Python