예측 정확도 확인하기
이제 학습한 모델이 얼마나 잘 예측하는지 확인해 볼 차례예요! 테스트 세트를 사용해 Decision Tree model의 정확도를 score() 메서드로 확인해 보세요.
이 연습은 강의의 일부입니다
HR Analytics: Python으로 직원 이탈 예측하기
연습 안내
- 학습용 데이터셋에서 decision tree
model을 사용해features를target에 맞춰 학습하세요. - 학습용 데이터셋에 대한 예측의 정확도
score()를 확인하세요. - 테스트 데이터셋에 대한 예측의 정확도
score()를 확인하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Apply a decision tree model to fit features to the target in the training set
model.fit(____,____)
# Check the accuracy score of the prediction for the training set
model.____(features_train,____)*100
# Check the accuracy score of the prediction for the test set
model.____(____,____)*100