开始使用免费开始使用

Model results using GridSearchCV

You discovered that the best parameters for your model are that the split criterion should be set to 'gini', the number of estimators (trees) should be 30, the maximum depth of the model should be 8 and the maximum features should be set to "log2".

Let's give this a try and see how well our model performs. You can use the get_model_results() function again to save time.

本练习是课程的一部分

Fraud Detection in Python

查看课程

练习说明

  • Input the optimal settings into the model definition.
  • Fit the model, obtain predictions and get the performance parameters with get_model_results().

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Input the optimal parameters in the model
model = RandomForestClassifier(class_weight={0:1,1:12}, ____='____',
            ____=____, ____='log2',  min_samples_leaf=10, ____=____, n_jobs=-1, random_state=5)

# Get results from your model
get_model_results(____, ____, ____, ____, ____)
编辑并运行代码