当前位置:网站首页>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可视化

边栏推荐
猜你喜欢

微信公众号授权登录后报redirect_uri参数错误的问题

The reason for not using bs4 is that the name is too long?Crawl lottery lottery information

482-静态库、动态库的制作、使用及区别

QT开发简介、命名规范、signal&slot信号槽

MySQL user authorization

MySQL 灵魂 16 问,你能撑到第几问?

CISP-PTE真题演示

The Road to Ad Monetization for Uni-app Mini Program Apps: Rewarded Video Ads

MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat

【菜鸡含泪总结】如何用pip、anaconda安装库
随机推荐
MySQL 用户授权
Jetson AGX Orin 平台关于c240000 I2C总线和GMSL ses地址冲突问题
Navicat cannot connect to mysql super detailed processing method
IDEA使用技巧
系统结构考点之并行计算霍纳法则
MySQL 游标
proxy反向代理
ML.NET相关资源整理
QT开发简介、命名规范、signal&slot信号槽
cmd (command line) to operate or connect to the mysql database, and to create databases and tables
Niu Ke Xiaobaiyue Race 53 A-E
cnpm的安装与使用
1064 Complete Binary Search Tree
d使用among的问题
折叠旧版应用程序
Google Earth Engine ——
DistSQL in-depth analysis: creating a dynamic distributed database
ClickHouse to create a database to create a table view dictionary SQL
ClickHouse 创建数据库建表视图字典 SQL
8 ways to get element attributes in JS