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 estimators and one with estimators.
Use RandomForestClassifier to create a model object, and assign the result to the variable rfmodel. You will provide the following arguments: criterion'entropy', nestimators
Fit rfmodel to the training data.
Use the predictproba method to use the fitted model rfmodel to predict values for the test data. The method will return two columns. Store the values of the second column to a list named rfpredictions Note: Remember to convert the resulting array to a list
Use RandomForestClassifier to create a model object, and assign the result to the variable rfmodel. You will provide the following arguments: criterion'entropy', nestimators
Fit rfmodel to the training data.
Use the predictproba method to use the fitted model rfmodel to predict values for the test data. The method will return two columns. Store the values of the second column to a list named rfpredictions 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
