足球比赛结果预测
下班后,我们经常在办公室玩几轮桌上足球。 我编写了一个小型 java 程序,可以从可用玩家中生成随机 2v2 阵容,然后将比赛结果存储在数据库中。
当前的结果预测使用 4 名相关球员之前所有比赛结果的简单平均值。 这给出了一个非常粗略的估计,但我想用更复杂的东西来替换它,考虑到以下因素:
- 玩家可能作为攻击者发挥出色,但作为防守者表现不佳(反之亦然)
- 玩家在对抗特定对手时表现出色/与其他团队相比,有些团队合作得很好
- 不会
- ,而另一些团队的技能
随着时间的推移而改变尽可能准确地预测游戏结果的最佳算法是什么?
有人建议为此使用神经网络,这听起来很有趣......但我没有足够的关于该主题的知识来判断这是否可行,而且我还怀疑可能需要太多的游戏才能进行合理的训练。
编辑:
由于一些项目的截止日期,不得不休息更长的时间。 为了使问题更具体:
给定以下 mysql 表,其中包含迄今为止播放的所有比赛:
table match_result
match_id int pk
match_start datetime
duration int (match length in seconds)
blue_defense int fk to table player
blue_attack int fk to table player
red_defense int fk to table player
red_attack int fk to table player
score_blue int
score_red int
您将如何编写函数 PredictResult(blueDef, blueAtk, redDef, redAtk) {...}
尽可能接近地估计结果,执行任何sql,进行计算或使用外部库?
In our office, we regularly enjoy some rounds of foosball / table football after work. I have put together a small java program that generates random 2vs2 lineups from the available players and stores the match results in a database afterwards.
The current prediction of the outcome uses a simple average of all previous match results from the 4 involved players. This gives a very rough estimation, but I'd like to replace it with something more sophisticated, taking into account things like:
- players may be good playing as attacker but bad as defender (or vice versa)
- players do well against a specific opponent / bad against others
- some teams work well together, others don't
- skills change over time
What would be the best algorithm to predict the game outcome as accurately as possible?
Someone suggested using a neural network for this, which sounds quite interesting... but I do not have enough knowledge on the topic to say if that could work, and I also suspect it might take too many games to be reasonably trained.
EDIT:
Had to take a longer break from this due to some project deadlines. To make the question more specific:
Given the following mysql table containing all matches played so far:
table match_result
match_id int pk
match_start datetime
duration int (match length in seconds)
blue_defense int fk to table player
blue_attack int fk to table player
red_defense int fk to table player
red_attack int fk to table player
score_blue int
score_red int
How would you write a function predictResult(blueDef, blueAtk, redDef, redAtk) {...}
to estimate the outcome as closely as possible, executing any sql, doing calculations or using external libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用TrueSkill算法,它非常擅长这一点。 我已经在足球和国际象棋中实现了它,效果非常好。 同事告诉我,它在这方面几乎太了。
有关其工作原理的完整详细信息以及我的实现的链接,请参阅我的“
Use the TrueSkill algorithm, it is very good at this. I've implemented it for foosball and chess and it works very well. Coworkers have told me that it's almost too good at this.
For complete details on how it works as well as a link to my implementation, see my "Computing Your Skill" blog post.
为什么使用神经网络? 使用统计数据,每个球员之间的相关性可能是一个很好的衡量标准。
Why use a neuralnet? Use statistics, probably the correlation between each player would be good measure.
首先让我们收集一些信息:
对于给定的球员,我们需要:
好的进攻者会得分。
一个好的防守者会阻止得分。
真正的信息将来自于优秀的攻击者与优秀的防守者的对抗。
Just to start let's gather some information:
For a given player we need:
A good attacker will rack up points.
A good defender will prevents points from being scored.
The real info will be from a good attacker playing against a good defender.
尝试应用朴素贝叶斯分类器。
完全相同的球员分布可能会导致不同的比赛结果。 如果您的数据中有一个模式,基于您的变量的模式,朴素贝叶斯分类器可能会产生良好的结果。
该算法不是很复杂。 我认为,一个具有一定概率知识的人,可以理解& 应用它。
在入侵检测系统中,它通过查看各种网络参数来确定网络异常。 贝叶斯方法在特定类型的数据中可能非常成功,并产生高 TP 和 TP 值。 低 FP 率。 但它也可能会导致较高的 FP 率,具体取决于您的数据。 您的数据将决定最佳方法。
您可以使用 Weka (http://www.cs.waikato.ac.nz /~ml/weka/),一个数据挖掘软件库,并尝试不同的算法。 它包含朴素贝叶斯分类器。
试试看吧。
Try applying Naive Bayes classifier.
The same exact distribution of the players may result in different match results. If your data has a pattern in it, a pattern based on your variables, Naive Bayes classifier may produce good results.
The algorithm is not very complex. I think, one with some knowledge in probability, can understand & apply it.
In intrusion detection systems, it is being used for determining network anomalies, by looking at various network parameters. Bayesian approach may be very successful in particular types of data and produce high TP & low FP rates. But it may also result in high FP rates, depending on your data. Your data will determine the best approach.
You can use Weka (http://www.cs.waikato.ac.nz/~ml/weka/), a data mining software library, and try different algorithms. It contains the Naive Bayes classifier.
Just try and see.
一种选择是尝试将点分布猜测为某种线性模型。 如果您的比赛数量多于玩家数量,则可以通过为所有比赛和结果构建游戏矩阵(一支球队的球员为+1,另一支球队的球员为-1,观众为0)来对每个球员的得分进行最小二乘拟合点差的向量。
One option would be to try and guess the point spread as some sort of linear model. If you have more games than players you, can do a least squares fit of points per player by building a games matrix (+1 for player on one team, -1 for the other, 0 for spectator) for all the games and a result vector for the spreads.