python - 在python中限制pdp图的轴范围
问题描述
我想在 Python 中为我的数据集生成 PDP 图。我正在使用 GradientBoostingClassifier 和数据集。
我得到的图对于每个元素都有不同的 Y 轴比例。我想将 Y 轴范围的限制设置在 0 和 1 之间。如何在 python 中实现这一点。下面是附图。
解决方案
在此之前执行以下操作plt.show()
:
plt.ylim(0, 1)
其中plt
由 定义import matplotlib.pyplot as plt
。
推荐阅读
- sql - 运算符和参数类型没有匹配的签名:BOOL、TIME。支持的签名:BOOL AND ([BOOL, ...])
- python - 当窗口值之和为零时,滚动和不显示为零
- zsh - compgen:96:找不到命令:尝试自动完成 aws 时的 aws_completer
- asp.net-core - 从部分视图模式弹出 Ajax 调用更新父视图模型
- android - 在 Google Play 商店中结束测试轨道
- javascript - 反应原生返回类型错误:null 不是对象(评估 feeds.length)
- arrays - ngFor 数组对象中的角度循环
- python - 如何处理这个带有多个选项卡的 csv 文件?
- webgl - Godot 3.1 WebGL 上下文丢失使用移动浏览器的错误
- c++ - 如何使用文件和行号抛出错误?