학습데이터와 테스트데이터 분리하기
# sklearn라이브러리의 model_selection 모듈의 train_test_split() 함수 from sklearn.model_selection import train_test_split # train_test_split() 함수는 - 파라미터 독립변수들의 데이터셋 X, 종속변수들의 데이터셋 Y, 테스트데이터로 분리할 비율값 - 리턴값 독립변수인 학습데이터, 독립변수인 테스트데이터, 종속변수인 학습데이터, 종속변수인 테스트데이터 순으로 리턴 ex) x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size = 0.3) . x_train과 y_train의 경우 같은 데이터쌍이고, 인덱스번호가 동일 x_test와 y_test도 같은 데..
2022. 5. 20.