IniziaInizia gratis

Random forest classifier

This exercise reviews the four modeling steps discussed throughout this chapter using a random forest classification model. You will:

  1. Create a random forest classification model.
  2. Fit the model using the tic_tac_toe dataset.
  3. Make predictions on whether Player One will win (1) or lose (0) the current game.
  4. Finally, you will evaluate the overall accuracy of the model.

Let's get started!

Questo esercizio fa parte del corso

Model Validation in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

from sklearn.ensemble import ____

# Create a random forest classifier
rfc = ____(n_estimators=50, max_depth=6, ____)
Modifica ed esegui il codice