新闻中心
英雄联盟大师 Baseline
该赛事围绕英雄联盟实时对局数据预测胜负展开。提供18万训练数据与2万测试数据,含击杀、伤害等30个字段,需预测测试集“win”标签,以准确率评分。Baseline流程含环境配置、代码运行等步骤,采用简单神经网络模型,还可通过提取交叉特征、加入验证集等优化模型提升成绩。
☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 免费无限量使用 DeepSeek R1 模型☜☜☜

赛事介绍
实时对战游戏是人工智能研究领域的一个热点。由于游戏复杂性、部分可观察和动态实时变化战局等游戏特点使得研究变得比较困难。我们可以在选择英雄阶段预测胜负概率,也可以在比赛期间根据比赛实时数据进行建模。那么我们英雄联盟对局进行期间,能知道自己的胜率吗?

赛事任务
比赛数据使用了英雄联盟玩家的实时游戏数据,记录下用户在游戏中对局数据(如击杀数、住物理伤害)。希望参赛选手能从数据集中挖掘出数据的规律,并预测玩家在本局游戏中的输赢情况。
赛题训练集案例如下:
- 训练集18万数据;
- 测试集2万条数据;
import pandas as pdimport numpy as nptrain = pd.read_csv('train.csv.zip')对于数据集中每一行为一个玩家的游戏数据,数据字段如下所示:
美图云修
商业级AI影像处理工具
50
查看详情
- id:玩家记录id
- win:是否胜利,标签变量
- kills:击杀次数
- deaths:死亡次数
- assists:助攻次数
- largestkillingspree:最大 killing spree(游戏术语,意味大杀特杀。当你连续杀死三个对方英雄而中途没有死亡时)
- largestmultikill:最大mult ikill(游戏术语,短时间内多重击杀)
- longesttimespentliving:最长存活时间
- doublekills:doublekills次数
- triplekills:doublekills次数
- quadrakills:quadrakills次数
- pentakills:pentakills次数
- totdmgdealt:总伤害
- magicdmgdealt:魔法伤害
- physicaldmgdealt:物理伤害
- truedmgdealt:真实伤害
- largestcrit:最大暴击伤害
- totdmgtochamp:对对方玩家的伤害
- magicdmgtochamp:对对方玩家的魔法伤害
- physdmgtochamp:对对方玩家的物理伤害
- truedmgtochamp:对对方玩家的真实伤害
- totheal:治疗量
- totunitshealed:痊愈的总单位
- dmgtoturrets:对炮塔的伤害
- timecc:法控时间
- totdmgtaken:承受的伤害
- magicdmgtaken:承受的魔法伤害
- physdmgtaken:承受的物理伤害
- truedmgtaken:承受的真实伤害
- wardsplaced:侦查守卫放置次数
- wardskilled:侦查守卫摧毁次数
- firstblood:是否为firstblood 测试集中label字段win为空,需要选手预测。
评审规则
- 数据说明
选手需要提交测试集队伍排名预测,具体的提交格式如下:
win0110
- 评估指标
本次竞赛的使用准确率进行评分,数值越高精度越高,评估代码参考:
from sklearn.metrics import accuracy_score y_pred = [0, 2, 1, 3]y_true = [0, 1, 2, 3]accuracy_score(y_true, y_pred)
Baseline使用指导
1、点击‘fork按钮’,出现‘fork项目’弹窗
2、点击‘创建按钮’ ,出现‘运行项目’弹窗
3、点击‘运行项目’,自动跳转至新页面
4、点击‘启动环境’ ,出现‘选择运行环境’弹窗
5、选择运行环境(启动项目需要时间,请耐心等待),出现‘环境启动成功’弹窗,点击确定
6、点击进入环境,即可进入notebook环境
7、鼠标移至下方每个代码块内(代码块左侧边框会变成浅蓝色),再依次点击每个代码块左上角的‘三角形运行按钮’,待一个模块运行完以后再运行下一个模块,直至全部运行完成

8、下载页面左侧submission.zip压缩包
9、在比赛页提交submission.zip压缩包,等待系统评测结束后,即可登榜!
10、点击页面左侧‘版本-生成新版本’
11、填写‘版本名称’,点击‘生成版本按钮’,即可在个人主页查看到该项目(可选择公开此项目哦)
import pandas as pdimport paddleimport numpy as np
%pylab inlineimport seaborn as sns
train_df = pd.read_csv('data/data137276/train.csv.zip')
test_df = pd.read_csv('data/data137276/test.csv.zip')
train_df = train_df.drop(['id', 'timecc'], axis=1)
test_df = test_df.drop(['id', 'timecc'], axis=1)/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/__init__.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import MutableMapping /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/rcsetup.py:20: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Iterable, Mapping /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/colors.py:53: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Sized
Populating the interactive namespace from numpy and matplotlib
数据分析
In [3]train_df.isnull().mean(0)
win 0.0 kills 0.0 deaths 0.0 assists 0.0 largestkillingspree 0.0 largestmultikill 0.0 longesttimespentliving 0.0 doublekills 0.0 triplekills 0.0 quadrakills 0.0 pentakills 0.0 totdmgdealt 0.0 magicdmgdealt 0.0 physicaldmgdealt 0.0 truedmgdealt 0.0 largestcrit 0.0 totdmgtochamp 0.0 magicdmgtochamp 0.0 physdmgtochamp 0.0 truedmgtochamp 0.0 totheal 0.0 totunitshealed 0.0 dmgtoturrets 0.0 totdmgtaken 0.0 magicdmgtaken 0.0 physdmgtaken 0.0 truedmgtaken 0.0 wardsplaced 0.0 wardskilled 0.0 firstblood 0.0 dtype: float64In [4]
train_df['win'].value_counts().plot(kind='bar')
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/cbook/__init__.py:2349: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working if isinstance(obj, collections.Iterator): /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/cbook/__init__.py:2366: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working return list(data) if isinstance(data, collections.MappingView) else data
<matplotlib.axes._subplots.AxesSubplot at 0x7f880d040d50>
<Figure size 432x288 with 1 Axes>In [5]
sns.distplot(train_df['kills'])
<matplotlib.axes._subplots.AxesSubplot at 0x7f88048a3b50>
<Figure size 432x288 with 1 Axes>In [5]
sns.distplot(train_df['deaths'])
<matplotlib.axes._subplots.AxesSubplot at 0x7f5bc9874d10>
<Figure size 432x288 with 1 Axes>In [6]
sns.boxplot(y='kills', x='win', data=train_df)
<matplotlib.axes._subplots.AxesSubplot at 0x7f87fc0b5a90>
<Figure size 432x288 with 1 Axes>In [7]
plt.scatter(train_df['kills'], train_df['deaths'])
plt.xlabel('kills')
plt.ylabel('deaths')Text(0,0.5,'deaths')
<Figure size 432x288 with 1 Axes>In [8]
for col in train_df.columns[1:]:
train_df[col] /= train_df[col].max()
test_df[col] /= test_df[col].max()
搭建模型
In [9]class Classifier(paddle.nn.Layer):
# self代表类的实例自身
def __init__(self):
# 初始化父类中的一些参数
super(Classifier, self).__init__()
self.fc1 = paddle.nn.Linear(in_features=29, out_features=40)
self.fc2 = paddle.nn.Linear(in_features=40, out_features=1)
self.relu = paddle.nn.ReLU()
# 网络的前向计算
def forward(self, inputs):
x = self.relu(self.fc1(inputs))
x = self.fc2(x) return x
In [10]
model = Classifier() model.train() opt = paddle.optimizer.SGD(learning_rate=0.01, parameters=model.parameters()) loss_fn = paddle.nn.BCEWithLogitsLoss()
W0427 14:43:44.334179 103 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 8.0, Driver API Version: 11.2, Runtime API Version: 11.2 W0427 14:43:44.338698 103 device_context.cc:465] device: 0, cuDNN Version: 8.2.In [11]
EPOCH_NUM = 2 # 设置外层循环次数BATCH_SIZE = 100 # 设置batch大小training_data = train_df.iloc[:-1000,].values.astype(np.float32)
val_data = train_df.iloc[-1000:, ].values.astype(np.float32)# 定义外层循环for epoch_id in range(EPOCH_NUM): # 在每轮迭代开始之前,将训练数据的顺序随机的打乱
np.random.shuffle(training_data)
# 将训练数据进行拆分,每个batch包含10条数据
mini_batches = [training_data[k:k+BATCH_SIZE] for k in range(0, len(training_data), BATCH_SIZE)]
# 定义内层循环
for iter_id, mini_batch in enumerate(mini_batches):
x = np.array(mini_batch[:, 1:]) # 获得当前批次训练数据
y = np.array(mini_batch[:, :1]) # 获得当前批次训练标签
# 将numpy数据转为飞桨动态图tensor的格式
features = paddle.to_tensor(x)
y = paddle.to_tensor(y)
# 前向计算
predicts = model(features)
# 计算损失
loss = loss_fn(predicts, y, )
*g_loss = paddle.mean(loss) if iter_id%200==0:
acc = (predicts > 0).astype(int).flatten() == y.flatten().astype(int)
acc = acc.astype(float).mean() print("epoch: {}, iter: {}, loss is: {}, acc is {}".format(epoch_id, iter_id, *g_loss.numpy(), acc.numpy()))
# 反向传播,计算每层参数的梯度值
*g_loss.backward() # 更新参数,根据设置好的学习率迭代一步
opt.step() # 清空梯度变量,以备下一轮计算
opt.clear_grad()epoch: 0, iter: 0, loss is: [0.6994627], acc is [0.49] epoch: 0, iter: 200, loss is: [0.7009081], acc is [0.36] epoch: 0, iter: 400, loss is: [0.6921266], acc is [0.57] epoch: 0, iter: 600, loss is: [0.6839013], acc is [0.64] epoch: 0, iter: 800, loss is: [0.6739801], acc is [0.75] epoch: 0, iter: 1000, loss is: [0.65885824], acc is [0.83] epoch: 0, iter: 1200, loss is: [0.66508365], acc is [0.71] epoch: 0, iter: 1400, loss is: [0.6578212], acc is [0.74] epoch: 0, iter: 1600, loss is: [0.6562445], acc is [0.72] epoch: 1, iter: 0, loss is: [0.6200185], acc is [0.85] epoch: 1, iter: 200, loss is: [0.62804365], acc is [0.79] epoch: 1, iter: 400, loss is: [0.6358215], acc is [0.75] epoch: 1, iter: 600, loss is: [0.6242084], acc is [0.76] epoch: 1, iter: 800, loss is: [0.6128205], acc is [0.78] epoch: 1, iter: 1000, loss is: [0.6186602], acc is [0.68] epoch: 1, iter: 1200, loss is: [0.57297456], acc is [0.79] epoch: 1, iter: 1400, loss is: [0.57423747], acc is [0.78] epoch: 1, iter: 1600, loss is: [0.58428985], acc is [0.75]In [12]
model.eval() test_data = paddle.to_tensor(test_df.values.astype(np.float32)) test_predict = model(test_data) test_predict = (test_predict > 0).astype(int).flatten()In [13]
pd.DataFrame({'win':
test_predict.numpy()
}).to_csv('submission.csv', index=None)
!zip submission.zip submission.csvupdating: submission.csv (deflated 90%)
总结与上分点
- 原始赛题字段存在关联,可以进一步提取交叉特征。
- 模型训练过程中可以加入验证集验证过程。
<br/>
以上就是英雄联盟大师 Baseline的详细内容,更多请关注其它相关文章!
# git
# 机械信息服务推广网站
# 网络营销推广软件报价
# 浑南区网站建设价格对比
# 推广网站的方法有哪些呢
# 二手行营销推广方案
# 晋宁谷歌seo优化营销
# 为什么网站推广很重要
# seo工作服
# 荆门网站推广排名收费
# 角形
# 前向
# 自己的
# 官网
# 压缩包
# 越高
# 运行环境
# 美图
# 一言
# 中文网
# type
# fig
# latte
# red
# 热点
# ai
# python
# 浙江关键词竞价排名
相关栏目:
【
行业资讯67740 】
【
技术百科0 】
【
网络运营39195 】
相关推荐:
j*a 数组怎么循环输出
ai文件在线打开工具有哪些
燃气热水器上的power是什么意思
如何编写一个linux命令
电焊机power灯亮是什么意思
企业征信不好如何恢复 企业征信不好怎么恢复步骤
如何打开命令提示符
固态硬盘如何测试
三星 nfc什么功能是什么意思
春运抢票如何抢连坐的票
play的三人称单数和过去式
得物怎样降低手续费 得物如何降低手续费教程
手机拍显示屏有条纹怎么去除
vue项目如何用typescript
j*a数组怎么存满
苹果16充电方式有哪些
春运抢票哪里最火热
如何使用net命令
花呗征信不好如何恢复 如何修复不良的花呗征信
酷我音乐怎么改每日推荐 酷我音乐每日推荐修改方法
苹果16有哪些自带配件
显示器的power是什么意思
光刻机是干什么用的
台达plc只有power灯亮是什么意思
区块链的热闹将何去何从?
市盈率ttm市盈动静是什么意思
如何在命令行写j*a程序
typescript全局配置放哪里
360n7锁屏壁纸怎么固定
ip dhcp是什么意思
固态硬盘4k如何看
汽车上power是什么意思
通配符的用法
春运抢票需要抢几天
单片机蜂鸣器响了怎么停
js怎么设置typescript
J*a数组静态怎么打
本科一批和本科二批是什么意思
tft单片机怎么写彩屏
12306退票手续费最新规定
单片机软件keil怎么运行
固态硬盘如何备份
grep命令的是如何实现
学typescript需要多久
如何把u盘改成固态硬盘
如何用命令查看数据库日志文件
2025年哪个局域网聊天软件好用
春运抢票需要什么软件抢
为什么夸克网盘下载不了
空调主板单片机怎么拆开


2025-07-21
浏览次数:次
返回列表