上接:2020美赛F奖论文(二):传球网络模型(PNM)的建立和影响因子分析
全文:
- 2020美赛F奖论文(一):摘要、绪论和模型准备
- 2020美赛F奖论文(二):传球网络模型(PNM)的建立和影响因子分析
- 2020美赛F奖论文(三):足球团队指标和基于机器学习的球队表现预测
- 2020美赛F奖论文(四):模拟退火算法驱动的结构策略设计
- 2020美赛F奖论文(五):结合团队动力学的模型拓展、模型评价
足球队中成功团队合作有许多指标,通过数据分析和实际经验,我们主要考虑以下indicators:静态指标和动态指标。首先,我们使用 G o a l ( G i ) Goal(G_{i}) Goal(Gi)
评价一场比赛的球队整体发挥,作为单场比赛表现标签,定义 G o a l ( G i ) Goal(G_{i}) Goal(Gi):
G o a l ( G i ) = { − 1 , O w n S c o r e − O p p o n e n t S c o r e < − 1 0 , O w n S c o r e − O p p o n e n t S c o r e ∈ [ − 1 , 1 ] 1 , O w n S c o r e − O p p o n e n t S c o r e > 1 Goal(G_{i}) = \left\{ \begin{matrix} - 1,\ \ OwnScore - OpponentScore < - 1 \\0,\ \ OwnScore - OpponentScore \in \left\lbrack - 1,1 \right\rbrack \\1,\ \ OwnScore - OpponentScore > 1 \\\end{matrix} \right. Goal(Gi)=⎩⎨⎧−1, OwnScore−OpponentScore<−10, OwnScore−OpponentScore∈[−1,1]1, OwnScore−OpponentScore>1
为了考虑球员位置分布,我们采出每个球员在整个赛季中的位置坐标,做出球员运动位置的热点图,热力图每个点的值定义如下:
Heatmap p k [ i , j ] = 1 4 δ 2 ∫ x − δ x + δ ∫ y − δ y + δ { 1 , p l a y e r h a s b e e n h e r e 0 , p l a y e r n e v e r p a s s e d dxdy , δ > 0 \text{Heatmap}_{p_{k}}\left\lbrack i,j \right\rbrack = \frac{1}{4\delta^{2}}\int_{x - \delta}^{x + \delta}{\int_{y - \delta}^{y + \delta}\left\{ \begin{matrix} 1,player\ has\ been\ here \\ 0,\ player\ never\ passed \\ \end{matrix}\text{dxdy} \right.\ },\delta > 0 Heatmappk[i,j]=4δ21∫x−δx+δ∫y−δy+δ{1,player has been here0, player never passeddxdy ,δ>0
颜色越深则表示出现在此处的频率较大,越浅表示出现的频率越小。经过 Heatmap p k [ i , j ] \text{Heatmap}_{p_{k}}\left\lbrack i,j \right\rbrack Heatmappk[i,j]的计算,主力11人的位置热点图如下:
在一场球赛中,球队的阵型对团队协作起到重要作用,我们考虑在一场球赛中球员阵型,我们采取每一场比赛中每一位球员的运动坐标,采用坐标对时间积分的方法,找出每场球赛中,每一位球员平均坐标。将在数据中可以获取(球员出现在Origin/Destination)的时间点作为新的横坐标,X或Y坐标作为新的纵坐标,得出函数 X ( t ) a n d Y ( t ) X\left(t \right)\ and\ Y(t) X(t) and Y(t)。我们近似认为在任意两个有记录的时间点,球员在X或Y方向上匀速移动,这样就将离散型的数据集转换为了连续性的数据集(每个)。因此平均坐标,以X坐标为例,Y坐标同理:
X ( t ) is a piece w i s e f u n c t i o n , X t is the X exactly when t. X\left( t \right)\text{\ is\ a\ }\text{piece}wise\ function,\ X_{t}\text{\ is\ the\ X\ exactly\ when\ t.} X(t) is a piecewise function, Xt is the X exactly when t.
{ AvgX ( p i ) = ∫ 0 90 m i n X ( t ) dt ≈ ∑ i = 1 n [ 1 2 ( t i + 1 − t i − 1 ) × X t ] n = n u m o f o u r e v e n t s \left\{ \begin{matrix} \text{AvgX}\left( p_{i} \right) = \int_{0}^{90min}{X\left( t \right)\text{dt}} \approx \sum_{i = 1}^{n}\left\lbrack \frac{1}{2}\left( t_{i + 1} - t_{i - 1} \right) \times X_{t} \right\rbrack \\ n = num\ of\ our\ events \\ \end{matrix} \right.\ {AvgX(pi)=∫090minX(t)dt≈∑i=1n[21(ti+1−ti−1)×Xt]n=num of our events
将这11位球员的位置标在图中绘制出每场球赛的阵型图,部分阵型图如下:
动态指标包括了球队人为影响因素和在比赛里产生的技术数据:人为影响因素包括了教练、对手水平、主客场,技术数据包括了射门、传球、解围在内的各种events统计。原始的数据以单个事件作为样本的单位,而我们将其分类统计为以一场比赛为单位的动态类型数据,通过观察以新结构存储的数据,提取出其中的若干特征信息。
在特征工程中,为了降低特征的维度,不仅使用PCA筛选并剔除影响不显著的特征,还可以使用ChiMerge这一特征分箱的方法,将EventSubTypes分为传球,进攻,防守和Fail四个方面,与教练、主客场、对手水平一起作为一场比赛的特征。通过标准化、哑变量、结合分析等方法处理统计后的数据来量化比赛的特征:
(1)统计型数据 Statistical data
D e f e n c e ( G i ) = C l e a r a n c e + B l o c k s + I n t e r r u p t i o n + A e r i a l D u a l + S a v e s Defence(G_{i}) = Clearance + Blocks + Interruption + Aerial\ Dual + Saves Defence(Gi)=Clearance+Blocks+Interruption+Aerial Dual+Saves
A t t a c k ( G i ) = S h o t s + D r i b b l e s + T o u c h + C o r n e r s + O f f s i d e Attack(G_{i}) = Shots + Dribbles + Touch + Corners + Offside Attack(Gi)=Shots+Dribbles+Touch+Corners+Offside
F a i l ( G i ) = L o s s o f P o s s e s s i o n + F o u l s Fail(G_{i}) = Loss\ of\ Possession + Fouls Fail(Gi)=Loss of Possession+Fouls
Oppo ( G i ) = P t s ( OpponentID ) + ∑ j = 1 38 GD j ( OpponentID ) \text{Oppo}\left( G_{i} \right) = Pts\left( \text{OpponentID} \right) + \sum_{j = 1}^{38}{\text{GD}_{j}\left( \text{OpponentID} \right)} Oppo(Gi)=Pts(OpponentID)+j=1∑38GDj(OpponentID)
(2)多事件结合分析型数据 Multi-event combined analysis data
P o s s e s s i o n ( G i ) = 1 90 m i n ∑ i = 2 n ( t i − t i + 1 ) , ( n i s t h e n u m b e r o f H u s k i e s ′ d a t a ) Possession(G_{i}) = \frac{1}{90min}\sum_{i = 2}^{n}{(t_{i} - t_{i + 1})},(n\ is\ the\ number\ of\ Huskies^{'}data) Possession(Gi)=90min1i=2∑n(ti−ti+1),(n is the number of Huskies′data)
(3)One-Hot编码哑变量数据 One-Hot encoded dummy variable data
Side ( G i ) = { 0 , h ome 1 , a w a y = { [ 1 , 0 ] , h o m e [ 0 , 1 ] , a w a y \text{Side}\left( G_{i} \right) = \left\{ \begin{matrix} 0,h\text{ome} \\ 1,away \\ \end{matrix} \right.\ = \left\{ \begin{matrix} \left\lbrack 1,0 \right\rbrack,home \\ \left\lbrack 0,1 \right\rbrack,away \\ \end{matrix} \right.\ Side(Gi)={0,home1,away ={[1,0],home[0,1],away
{ Coac h ( 1 ) = [ 1 , 0 , 0 ] Coac h ( 2 ) = [ 0 , 1 , 0 ] Coac h ( 3 ) = [ 0 , 0 , 1 ] \left\{ \begin{matrix} \text{Coac}h\left( 1 \right) = \left\lbrack 1,0,0 \right\rbrack \\ \text{Coac}h\left( 2 \right) = \left\lbrack 0,1,0 \right\rbrack \\ \text{Coac}h\left( 3 \right) = \left\lbrack 0,0,1 \right\rbrack \\ \end{matrix} \right.\ ⎩⎨⎧Coach(1)=[1,0,0]Coach(2)=[0,1,0]Coach(3)=[0,0,1]
分析 Side ( G i ) \text{Side}\left( G_{i} \right) Side(Gi) 对 于 对于 对于 Goal ( G i ) a n d R a t i n g s ( G i ) \text{\ Goal}\left( G_{i} \right)\ and\ Ratings(G_{i}) Goal(Gi) and Ratings(Gi)影响:
Side ( G i ) = 0 \text{Side}\left( G_{i} \right) = 0 Side(Gi)=0时 Goal ( G i ) = 0 o r 1 \text{Goal}\left( G_{i} \right) = 0\ or\ 1 Goal(Gi)=0 or 1的分布更多, R a t i n g s ( G i ) Ratings(G_{i}) Ratings(Gi)分布更高,因此主场表现结果整体上比客场要好。
分析不同Coach的执教水平以及对于球队 Attack ( G i ) , D e f e n c e ( G i ) , P a s s e s ( G i ) a n d F a i l ( G i ) \text{Attack}\left( G_{i} \right),Defence\left( G_{i} \right),Passes\left( G_{i} \right)\ and\ Fail(G_{i}) Attack(Gi),Defence(Gi),Passes(Gi) and Fail(Gi)的指导成效:
从boxen图我们可以看出,在Coach 3指导下,球队 Goal ( G i ) , A t t a c k ( G i ) \text{Goal}\left( G_{i} \right),Attack\left( G_{i} \right) Goal(Gi),Attack(Gi)等数据较好,其次是Coach 2和Coach 1。我们还可以得出教练们的执教风格,例如:教练1更具侵略性,防守就显得平庸;教练2强调强硬防守;教练3则较为平衡,战绩最佳。
分析 Attack ( G i ) \text{Attack}\left( G_{i} \right) Attack(Gi)、 Passes ( G i ) \text{Passes}\left( G_{i} \right) Passes(Gi)对于 Goal ( G i ) \text{\ Goal}\left( G_{i} \right) Goal(Gi)的贡献:
从图中我们可以看出,在不同净胜球数下,进攻和传球大体上为线性相关,斜率为正。
{ Passes ( G i ) in [ 0.0 , 1.0 ] , A t t a c k ( G i ) in [ 0.0 , 0.9 ] , G o a l ( G i ) < 0 Passes ( G i ) in [ 0.0 , 1.0 ] , A t t a c k ( G i ) in [ 0.1 , 1.0 ] , G o a l ( G i ) = 0 Passes ( G i ) in [ 0.5 , 0.8 ] , A t t a c k ( G i ) in [ 0.6 , 1.0 ] , G o a l ( G i ) > 0 , M a i n l y \left\{ \begin{matrix} \text{Passes}\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.0,1.0 \right\rbrack,Attack\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.0,0.9 \right\rbrack,Goal\left( G_{i} \right) < 0 \\ \text{Passes}\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.0,1.0 \right\rbrack,Attack\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.1,1.0 \right\rbrack,Goal\left( G_{i} \right) = 0 \\ \text{Passes}\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.5,0.8 \right\rbrack,Attack\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.6,1.0 \right\rbrack,Goal\left( G_{i} \right) > 0 \\ \end{matrix},\ Mainly \right.\ ⎩⎨⎧Passes(Gi) in [0.0,1.0],Attack(Gi) in [0.0,0.9],Goal(Gi)<0Passes(Gi) in [0.0,1.0],Attack(Gi) in [0.1,1.0],Goal(Gi)=0Passes(Gi) in [0.5,0.8],Attack(Gi) in [0.6,1.0],Goal(Gi)>0, Mainly
G o a l ( G i ) Goal(G_{i}) Goal(Gi)与 Passes ( G i ) and Attack ( G i ) \text{Passes}\left( G_{i} \right)\text{\ and\ Attack}\left( G_{i} \right) Passes(Gi) and Attack(Gi)呈正相关,且分布越集中, Passes ( G i ) and Attack ( G i ) \text{Passes}\left( G_{i} \right)\text{\ and\ Attack}\left( G_{i} \right) Passes(Gi) and Attack(Gi)的方差较小。我们可以得出结论:在一场球赛乃至整个赛季, G o a l ( G i ) Goal(G_{i}) Goal(Gi)越多,大概率有着更高的 Passes ( G i ) and Attack ( G i ) \text{Passes}\left(G_{i} \right)\text{\ and\ Attack}\left( G_{i} \right) Passes(Gi) and Attack(Gi)。
分析 Defence ( G i ) \text{Defence}\left( G_{i} \right) Defence(Gi)、 Fail ( G i ) \text{Fail}\left( G_{i} \right) Fail(Gi)对于 Goal ( G i ) \text{\ Goal}\left( G_{i} \right) Goal(Gi)的贡献:
{ Fail ( G i ) in [ − 1.0 , − 0.2 ] , D e f e n c e ( G i ) in [ 0.0 , 0.5 ] , G o a l ( G i ) < 0 Fail ( G i ) in [ − 1.0 , 0.0 ] , D e f e n c e ( G i ) in [ 0.0 , 1.0 ] , G o a l ( G i ) = 0 Fail ( G i ) in [ − 0.6 , − 0.2 ] , D e f e n c e ( G i ) in [ 0.0 , 0.7 ] , G o a l ( G i ) > 0 , M a i n l y \left\{ \begin{matrix} \text{Fail}\left( G_{i} \right)\text{\ in\ }\left\lbrack - 1.0, - 0.2 \right\rbrack,Defence\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.0,0.5 \right\rbrack,Goal\left( G_{i} \right) < 0 \\ \text{Fail}\left( G_{i} \right)\text{\ in\ }\left\lbrack - 1.0,0.0 \right\rbrack,Defence\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.0,1.0 \right\rbrack,Goal\left( G_{i} \right) = 0 \\ \text{Fail}\left( G_{i} \right)\text{\ in\ }\left\lbrack - 0.6, - 0.2 \right\rbrack,Defence\left( G_{i} \right)\text{\ in\ }\left\lbrack 0.0,0.7 \right\rbrack,Goal\left( G_{i} \right) > 0 \\ \end{matrix},\ Mainly \right.\ ⎩⎨⎧Fail(Gi) in [−1.0,−0.2],Defence(Gi) in [0.0,0.5],Goal(Gi)<0Fail(Gi) in [−1.0,0.0],Defence(Gi) in [0.0,1.0],Goal(Gi)=0Fail(Gi) in [−0.6,−0.2],Defence(Gi) in [0.0,0.7],Goal(Gi)>0, Mainly
Goal ( G i ) \text{Goal}\left( G_{i} \right) Goal(Gi)与 Defence ( G i ) \text{Defence}\left( G_{i} \right) Defence(Gi)呈正相关,与 ∣ Fail ( G i ) ∣ \left| \text{Fail}\left( G_{i} \right) \right| ∣Fail(Gi)∣呈负相关,且分布越集中, Defence ( G i ) and Fail ( G i ) \text{Defence}\left( G_{i} \right) \text{and}\text{\ Fail}\left( G_{i}\right) Defence(Gi)and Fail(Gi)的方差较小。观察发现:图2左1的点分布在下方,因此防守不好会导致输球;右1左半边没有点,因此期望赢球则失误不能多。
以 Attack ( G i ) , D e f e n c e ( G i ) , P a s s e s ( G i ) \text{Attack}\left( G_{i} \right),Defence\left( G_{i} \right),Passes\left( G_{i} \right) Attack(Gi),Defence(Gi),Passes(Gi)作为考察球队整体表现的positive指标,结合 Passes ( G i ) , O p p o ( G i ) \text{Passes}\left( G_{i} \right),Oppo\left( G_{i} \right) Passes(Gi),Oppo(Gi)指标进行多角度分析:
从左图中我们可以看出数据重心分布在右下角,认为整个赛季上 Attack ( G i ) \text{Attack}\left( G_{i} \right) Attack(Gi)(进攻表现)显著优于 Defence ( G i ) \text{Defence}\left( G_{i} \right) Defence(Gi)(防守表现)。从右图中我们可以看出不论是在主场还是客场, Passes ( G i ) ∝ [ α 1 Oppo ( G i ) + β ] \text{Passes}\left( G_{i} \right) \propto \left\lbrack \alpha\frac{1}{\text{Oppo}\left( G_{i}\right)} + \beta\right\rbrack Passes(Gi)∝[αOppo(Gi)1+β],但主场更可能有较小提升;结论是对手水平越高,我方传球率越低。
综合所有处理得到的特征,通过Pearson相关系数的计算来估计出变量间两两特征相关性。
r xy = N ∑ x i y i − ∑ x i ∑ y i N ∑ x i 2 − ( ∑ x i ) 2 N ∑ y i 2 − ( ∑ y i ) 2 r_{\text{xy}} = \frac{N\sum_{}^{}{x_{i}y_{i} - \sum_{}^{}{x_{i}\sum_{}^{}y_{i}}}}{\sqrt{N\sum_{}^{}x_{i}^{2} - \left( \sum_{}^{}x_{i} \right)^{2}}\sqrt{N\sum_{}^{}y_{i}^{2} - \left( \sum_{}^{}y_{i} \right)^{2}}} rxy=N∑xi2−(∑xi)2N∑yi2−(∑yi)2N∑xiyi−∑xi∑yi
令矩阵 Arr [ i , j ] = r ij \text{Arr}\left\lbrack i,j \right\rbrack = r_{\text{ij}} Arr[i,j]=rij,得:
我们以 G o a l ( G i ) Goal(G_{i}) Goal(Gi)作为每场比赛评价标签,希望学习后的模型能够基于处理后的数据对比赛进行分类,对应到 G o a l ( G i ) Goal(G_{i}) Goal(Gi)的标签。由于 M = 10 M=10 M=10个特征数量较多,且与标签相关性不一,不宜采用线性模型进行分类;且样本数据 N = 38 N=38 N=38数量极少,在尝试一些深度学习算法时容易有较大偏差。综上,我们选择随机森林模型建立 G o a l ( G i ) Goal(G_{i}) Goal(Gi)标签分类器。
随机森林是一个包含多个决策树的分类器,
并且其输出的类别是由个别树输出的类别的众数而定。对于很多种资料,它可以产生高准确度的分类器;它可以在决定类别时,评估变数的重要性;在建造森林时,它可以在内部对于一般化后的误差产生不偏差的估计。建立随机森林分类器Random
Forest Classifier的方法如下:
输入特征数目 m m m,用于确定决策树上一个节点的决策结果 m < M 2 m < \sqrt[2]{M} m<2M;
利用Bootstrap取样,从 N N N个训练用例中以有放回抽样的方式,取样 N N N次,形成一个训练集,并用未抽到的用例作预测,评估其误差;
对于每一个节点,随机选择m个特征,决策树上每个节点的决定都是基于这些特征确定的。根据这m个特征,计算其最佳的分裂方式;
每棵树都会完整成长而不会剪枝,这有可能在建完一棵正常树状分类器后会被采用。
随机森林分类器的训练后,使用网格搜索grid search进行参数调优,选定
{ n _ e s t i m a t o r = 50 rando m rate = 0 m a x _ d e p t h = 3 m a x _ f e a t u r e = M 2 \left\{ \begin{matrix} n\_ estimator = 50 \\ \text{rando}m_{\text{rate}} = 0 \\ max\_ depth = 3 \\ max\_ feature = \sqrt[2]{M} \\ \end{matrix} \right.\ ⎩⎪⎪⎨⎪⎪⎧n_estimator=50randomrate=0max_depth=3max_feature=2M
作为参数,利用K折交叉验证验计算其accuracy score,用于评估模型准确率。
经过一定的数据调整和多次模拟结果,平均情况下得分为 65.8 % 65.8\% 65.8%,最好的数据情况下可以达到 80 − 90 % 80- 90\% 80−90%的得分,在样本规模仅有 N = 38 N = 38 N=38的情况下,我们可以接受这一模型通过动态指标对比赛净胜球情况进行预测的准确率。
下接:2020美赛F奖论文(四):模拟退火算法驱动的结构策略设计
全文:
- 2020美赛F奖论文(一):摘要、绪论和模型准备
- 2020美赛F奖论文(二):传球网络模型(PNM)的建立和影响因子分析
- 2020美赛F奖论文(三):足球团队指标和基于机器学习的球队表现预测
- 2020美赛F奖论文(四):模拟退火算法驱动的结构策略设计
- 2020美赛F奖论文(五):结合团队动力学的模型拓展、模型评价