当前位置:网站首页>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可视化
边栏推荐
- TransGAN code reproduction - Jiutian Bisheng Platform
- Niu Ke Xiaobaiyue Race 53 A-E
- Chrome 配置samesite=none方式
- 系统结构考点之并行计算霍纳法则
- navicat无法连接mysql超详细处理方法
- Navicat connection MySQL error: 1045 - Access denied for user 'root'@'localhost' (using password YES)
- 1064 Complete Binary Search Tree
- The Road to Ad Monetization for Uni-app Mini Program Apps: Rewarded Video Ads
- 【导航规划】导航规划背景知识总结
- cnpm installation steps
猜你喜欢
随机推荐
The reason for not using bs4 is that the name is too long?Crawl lottery lottery information
mysql去除重复数据
2sk2225代换3A/1500V中文资料【PDF数据手册】
【Summary】机器人方法汇总
折叠旧版应用程序
cookie和session区别
类和对象——上
OpenCV笔记(二十):滤波函数——filter2D
微信公众号授权登录后报redirect_uri参数错误的问题
The mysql time field is set to the current time by default
2022.7.28
ClickHouse to create a database to create a table view dictionary SQL
IDEA使用技巧
使用LVS和Keepalived搭建高可用负载均衡服务器集群
系统结构考点之流水线向量点积
DistSQL in-depth analysis: creating a dynamic distributed database
MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
登堂入室之soc开发makefile
MySQL 用户授权
面试难题:分布式 Session 实现难点,这篇就够!