当前位置: 首页 > article >正文

Python基础学习-Day32

面对一个全新的官方库,是否可以借助官方文档的写法了解其如何使用。

我们以pdpbox这个机器学习解释性库来介绍如何使用官方文档。

大多数 Python 库都会有官方文档,里面包含了函数的详细说明、用法示例以及版本兼容性信息。

通常查询方式包含以下2种:

  1. GitHub 仓库:https://github.com/SauceCat/PDPbox
  2. PyPI 页面:https://pypi.org/project/PDPbox/
  3. 官方文档:https://pdpbox.readthedocs.io/en/latest/

一般通过github仓库都可以找到对应的官方文档那个。

在官方文档中搜索函数名,然后查看函数的详细说明和用法示例。

iris = load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df['target'] = iris.target 
features = iris.feature_names  
target = 'target'X_train, X_test, y_train, y_test = train_test_split(df[features], df[target], test_size=0.2, random_state=42
)model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)import  pdpbox
print(pdpbox.__version__)from pdpbox.info_plots import TargetPlotfeature = 'petal length (cm)'
feature_name = feature feature = 'petal length (cm)'
feature_name = feature 
)
target_plot = TargetPlot(df=df, feature=feature, feature_name=feature_name,  # target='target',target='target',  grid_type='percentile',  num_grid_points=10 target_plot.plot()
type(target_plot.plot())
len(target_plot.plot())
target_plot.plot()[0]
target_plot.plot()[2]fig, axes, summary_df = target_plot.plot(which_classes=None,  show_percentile=True,  engine='plotly',template='plotly_white'
)
)
fig.update_layout(width=800, height=500,  title=dict(text=f'Target Plot: {feature_name}', x=0.5)  fig.show()

@浙大疏锦行

http://www.lryc.cn/news/2383734.html

相关文章:

  • 离线服务器算法部署环境配置
  • AIGC工具平台-卡通图片2D转绘3D
  • docker 启动一个python环境的项目dockerfile版本
  • Java虚拟机 -方法调用
  • 基于matlabcd7.x的无网格近似方法
  • JMeter JDBC请求Query Type实测(金仓数据库版)
  • 【内部教程】ISOLAR-AB配置以太网栈|超详细实战版
  • 哈希表和容器中添加元素的方法
  • Nginx 核心功能
  • String.join()-高效字符串拼接
  • 【Canvas与图标】圆角方块蓝星CSS图标
  • 系统性能分析基本概念(5) : 何时开始性能分析
  • Python实现Web请求与响应
  • 机器学习 day05
  • CentOS Stream安装MinIO教程
  • C#新建打开文件对话框
  • 汇川PLC通过开疆智能Profinet转ModbusTCP网关读取西门子PLC数据案例
  • 零基础入门:MinerU 和 PyTorch、CUDA的关系
  • 借助IEDA ,Git版本管理工具快速入门
  • 三维空间,毫秒即达:RTMP|RTSP播放器在Unity中的落地实现
  • 【计算机网络】HTTP/1.0,HTTP/1.1,HTTP/2,HTTP/3汇总讲解,清晰表格整理面试重点对比
  • ubuntu 搭建FTP服务,接收部标机历史音视频上报服务器
  • 一、内存调优
  • IDEA启动报错:Cannot invoke “org.flowable.common.engine.impl.persistence.ent
  • 从加密到信任|密码重塑车路云一体化安全生态
  • Java的Filter与Spring的Interceptor的比较
  • 多线程编程的典型使用场景
  • grafana dashboard 单位 IEC SI a i
  • WPF···
  • Git的工作流程