Random forest classifier
This exercise reviews the four modeling steps discussed throughout this chapter using a random forest classification model. You will:
- Create a random forest classification model.
- Fit the model using the
tic_tac_toedataset. - Make predictions on whether Player One will win (1) or lose (0) the current game.
- Finally, you will evaluate the overall accuracy of the model.
Let's get started!
Latihan ini adalah bagian dari kursus
Model Validation in Python
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
from sklearn.ensemble import ____
# Create a random forest classifier
rfc = ____(n_estimators=50, max_depth=6, ____)