Question: In the code cell below, build and train two random forest models, one with 2 0 estimators and one with 1 0 0 estimators. Use

In the code cell below, build and train two random forest models, one with 20 estimators and one with 100 estimators.
Use RandomForestClassifier() to create a model object, and assign the result to the variable rf_20_model. You will provide the following arguments: criterion='entropy', n_estimators=20.
Fit rf_20_model to the training data.
Use the predict_proba() method to use the fitted model rf_20_model to predict values for the test data. The method will return two columns. Store the values of the second column to a list named rf_20_predictions (Note: Remember to convert the resulting array to a list).
Use RandomForestClassifier() to create a model object, and assign the result to the variable rf_100_model. You will provide the following arguments: criterion='entropy', n_estimators=100.
Fit rf_100_model to the training data.
Use the predict_proba() method to use the fitted model rf_100_model to predict values for the test data. The method will return two columns. Store the values of the second column to a list named rf_100_predictions (Note: Remember to convert the resulting array to a list).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!