当前位置:网站首页>ML's shap: Based on FIFA 2018 Statistics (2018 Russia World Cup) team match star classification prediction data set using RF random forest + calculating SHAP value single-sample force map/dependency c
ML's shap: Based on FIFA 2018 Statistics (2018 Russia World Cup) team match star classification prediction data set using RF random forest + calculating SHAP value single-sample force map/dependency c
2022-07-30 22:06:00 【A virgo's program ape】
ML之shap:基于FIFA 2018 Statistics(20182008 World Cup in Russia)Team match star classification prediction dataset utilizationRF随机森林+计算SHAPValue One-Sample Force Plot/A detailed guide to interpretability by visualizing dependency contribution graphs
目录
# 3、Model building and training
# 4.1、A single sample is based onshapvalue for interpretation visualization
# (1)、Pick a piece of sample data and convert toarray格式
# 4.2、Multiple samples are based onshapvalue for interpretation visualization
# (1)、基于树模型TreeExplainer创建Explainer并计算SHAP值
# (2)、The features of the full validation dataset samplesshap值summary_plot可视化
# (3)、Dependency contribution graphdependence_plot可视化
相关文章
ML:Machine Learning InterpretabilitySHAPUnderstanding of value for single-sample single-feature prediction
ML之shap:基于FIFA 2018 Statistics(20182008 World Cup in Russia)Team match star classification prediction dataset utilizationRF随机森林+计算SHAPA detailed walkthrough of the single-sample effort to visualize interpretability
ML之shap:基于FIFA 2018 Statistics(20182008 World Cup in Russia)Team match star classification prediction dataset utilizationRF随机森林+计算SHAPA detailed walkthrough of the single-sample effort to visualize interpretability
基于FIFA 2018 Statistics(20182008 World Cup in Russia)Team match star classification prediction dataset utilizationRF随机森林+计算SHAPValue One-Sample strives to visualize interpretability
# 1、定义数据集
Date | Team | Opponent | Goal Scored | Ball Possession % | Attempts | On-Target | Off-Target | Blocked | Corners | Offsides | Free Kicks | Saves | Pass Accuracy % | Passes | Distance Covered (Kms) | Fouls Committed | Yellow Card | Yellow & Red | Red | Man of the Match | 1st Goal | Round | PSO | Goals in PSO | Own goals | Own goal Time |
14-06-2018 | Russia | Saudi Arabia | 5 | 40 | 13 | 7 | 3 | 3 | 6 | 3 | 11 | 0 | 78 | 306 | 118 | 22 | 0 | 0 | 0 | Yes | 12 | Group Stage | No | 0 | ||
14-06-2018 | Saudi Arabia | Russia | 0 | 60 | 6 | 0 | 3 | 3 | 2 | 1 | 25 | 2 | 86 | 511 | 105 | 10 | 0 | 0 | 0 | No | Group Stage | No | 0 | |||
15-06-2018 | Egypt | Uruguay | 0 | 43 | 8 | 3 | 3 | 2 | 0 | 1 | 7 | 3 | 78 | 395 | 112 | 12 | 2 | 0 | 0 | No | Group Stage | No | 0 | |||
15-06-2018 | Uruguay | Egypt | 1 | 57 | 14 | 4 | 6 | 4 | 5 | 1 | 13 | 3 | 86 | 589 | 111 | 6 | 0 | 0 | 0 | Yes | 89 | Group Stage | No | 0 | ||
15-06-2018 | Morocco | Iran | 0 | 64 | 13 | 3 | 6 | 4 | 5 | 0 | 14 | 2 | 86 | 433 | 101 | 22 | 1 | 0 | 0 | No | Group Stage | No | 0 | 1 | 90 |
# 2、数据预处理
# 2.1、分离特征与标签
df_X Goal Scored Ball Possession % Attempts ... Yellow & Red Red Goals in PSO
0 5 40 13 ... 0 0 0
1 0 60 6 ... 0 0 0
2 0 43 8 ... 0 0 0
3 1 57 14 ... 0 0 0
4 0 64 13 ... 0 0 0
[5 rows x 18 columns]
df_y 0 True
1 False
2 False
3 True
4 False
Name: Man of the Match, dtype: bool
# 3、Model building and training
# 3.1、数据集切分
# 3.2、模型训练
# 4、模型特征重要性解释可视化
# 4.1、A single sample is based onshapvalue for interpretation visualization
# (1)、Pick a piece of sample data and convert toarray格式
输出当前测试样本:5
Goal Scored 2
Ball Possession % 38
Attempts 13
On-Target 7
Off-Target 4
Blocked 2
Corners 6
Offsides 1
Free Kicks 18
Saves 1
Pass Accuracy % 69
Passes 399
Distance Covered (Kms) 148
Fouls Committed 25
Yellow Card 1
Yellow & Red 0
Red 0
Goals in PSO 3
Name: 118, dtype: int64
输出当前测试样本的真实label: False
输出当前测试样本的的预测概率: [[0.29 0.71]]
输出当前测试样本:7
Goal Scored 0
Ball Possession % 53
Attempts 16
On-Target 4
Off-Target 10
Blocked 2
Corners 7
Offsides 1
Free Kicks 20
Saves 1
Pass Accuracy % 77
Passes 466
Distance Covered (Kms) 107
Fouls Committed 23
Yellow Card 1
Yellow & Red 0
Red 0
Goals in PSO 0
Name: 35, dtype: int64
输出当前测试样本的真实label: False
输出当前测试样本的的预测概率: [[0.56 0.44]]
# (2)、利用Shap值解释RFC模型
# T1、基于树模型TreeExplainer创建Explainer并计算SHAP值,And a single-sample effort is visualized(Analyze the interpretation of single-sample predictions)
# T2、kernel based modelKernelExplainer创建Explainer并计算SHAP值,And a single-sample effort is visualized(Analyze the interpretation of single-sample predictions)
# 4.2、Multiple samples are based onshapvalue for interpretation visualization
# (1)、基于树模型TreeExplainer创建Explainer并计算SHAP值
# (2)、The features of the full validation dataset samplesshap值summary_plot可视化
# (3)、Dependency contribution graphdependence_plot可视化
边栏推荐
- 设备树的引入与体验
- 系统结构考点之PM2I单级网络
- MySQL cursors
- socket: Kernel initialization and detailed process of creating streams (files)
- Qt 同时生成动态库和静态库
- 小心你的字典和样板代码
- The Road to Ad Monetization for Uni-app Mini Program Apps: Rewarded Video Ads
- ThinkPHP高仿蓝奏云网盘系统源码/对接易支付系统程序
- 2022.7.28
- It is enough for MySQL to have this article (disgusting typing 37k words, just for Bojun!!!)
猜你喜欢
MySQL 8.0.29 decompressed version installation tutorial (valid for personal testing)
DistSQL 深度解析:打造动态化的分布式数据库
The reason for not using bs4 is that the name is too long?Crawl lottery lottery information
openim支持十万超级大群
8 ways to get element attributes in JS
WSL2设置默认启动用户(debian)
WSL安装图形界面并通过xrdp/X-Launch访问
不用bs4的原因居然是名字太长?爬取彩票开奖信息
ClickHouse 数据插入、更新与删除操作 SQL
How strict Typescript strict mode?
随机推荐
系统结构考点之多级混洗交换网络
WSL安装图形界面并通过xrdp/X-Launch访问
MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql
【微信小程序】小程序突破小程序二维码数量限制
navicat无法连接mysql超详细处理方法
【科研】文献下载神器方式汇总
Uni-app 小程序 App 的广告变现之路:激励视频广告
MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
史上超强最常用SQL语句大全
mysql创建表
OpenCV笔记(二十):滤波函数——filter2D
Installation and use of cnpm
基于ABP实现DDD--实体创建和更新
成功解决ModuleNotFoundError: No module named ‘Image‘
3分钟带你了解微信小程序开发
Rust编译报错:error: linker `cc` not found
d违反常了吗
MySQL 灵魂 16 问,你能撑到第几问?
About the data synchronization delay of MySQL master-slave replication
MySQL 5.7 detailed download, installation and configuration tutorial