plotPartialDependence matlab
时间: 2023-12-20 09:05:51 浏览: 107
matlab xgboost安装调试
```python
from matplotlib import pyplot as plt
from pdpbox import pdp, get_dataset, info_plots
# 创建要绘制的数据
pdp_goals = pdp.pdp_isolate(model=tree_model, dataset=val_X, model_features=feature_names, feature='Goal Scored')
# 绘制部分依赖图
pdp.pdp_plot(pdp_goals, 'Goal Scored')
plt.show()
```
```python
feature_to_plot = 'Distance Covered (Kms)'
pdp_dist = pdp.pdp_isolate(model=tree_model, dataset=val_X, model_features=feature_names, feature=feature_to_plot)
pdp.pdp_plot(pdp_dist, feature_to_plot)
plt.show()
```
阅读全文