Python에서의 모델 검증
Kasey Jones
Data Scientist

| 데이터셋 | 정의 |
|---|---|
| Train | 모델 학습에 사용하는 데이터 샘플 |
| Test (holdout sample) | 모델 성능을 평가하는 데이터 샘플 |
비율 예시
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]
더미 변수 관련 Python 강좌:
X_train, X_test, y_train, y_test =\
train_test_split(X, y, test_size=0.2, random_state=1111)
매개변수:
test_sizetrain_sizerandom_state서로 다른 모델 파라미터를 시험할 때는?

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)
Python에서의 모델 검증