Question: Fill in the missing code inside the TODO sections. In particular, add the following parts 1 . Add a _ gini method to calculate gini
Fill in the missing code inside the TODO sections. In particular, add the following parts Add a gini method to calculate gini index so the model can switch between using entropy and gini as the criterion. Make the fit and predict method work with DataFrame instead of numpy arrays. Make the code work for the case where the target variable can be a categorical variable as well as integer variable from encoding the different classification classes. Add classificationreport and confusionmatrix functions Implement the RandomForest model.
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
