Вы находитесь на странице: 1из 6

Predicting Football Matches using Neural Networks in MATLAB

__________________________________________________________________________________________________________________________

Predicting Football Matches using Neural Networks in MATLAB


Andrade, Pablo; Cisneros Jorge; Surez Francisco

Escuela Politcnica Nacional, Faculty of Mechanical Engineering, Quito, Ecuador


Mechatronics

Abstract:
The purpose of this project is to anticipate the outcome of a football match of a local team (LDU) using various types
of neural networks via MATLAB. To achieve the objective of the project a series of input data has to be collected
in relation with the football team in question, the data was collected based on past matches records against
different teams. With the relevant data and the target for the project three virtual neural networks where trained
(Perceptron, Feed-Forward and Cascade) and simulated with the latest match played by the home team to see if
the network could predict accurately the outcome of the match.
The best results were achieved with the implementation of a feed-forward neural network. These results as well as
the results from the other types of networks utilized are thoroughly discussed in this project.

fare, simply because the analysis can use more data. On the
other hand, the bigger the percentage of the data that is used
for testing, the more statistically reliable our test will be. In
order to split all of the data, Weka offers a very good solution
for this problem, namely a ten-fold cross validation. It splits
the data into ten equal-sized portions and uses nine out of ten
portions as training data and the last one as testing data. It
repeats the process ten times, each time choosing a different
portion as the testing data [2].
The selection of the relevant features is an important feature
since an accurate set makes it a lot easier to predict the
outcomes of matches. Features are characteristics of recent
matches of the teams involved, but how far in history do we
need to go in order to get the best predictions? To answer this
question we set up a very basic set of features and then each
time we changed the amount of history looked at and
compared the results. This initial set included the following
features:

INTRODUCTION

There are many methods to predict the outcome of a football


match. It can be predicted via a statistic model, using an
ordered probit regression model. This particular method was
used to predict English league football matches [1].
In the static model, a wide range of variables were taken in
account, in addition to the different teams past matches
results data. These variables are the significance of each
match for championship, promotion or relegation issues; the
involvement of the teams in cup competition; the
geographical distance between the teams home towns; and
a big team effect [1].
Knowing that these results will serve as a starting point in
establishing the prices and award for betting in the sports
industry, the efficiency of such prices is also analyzed using
empirical results [1].
A limited but increasing number of academic researchers
have attempted to model match results data for football. It is
in this way that it can be observed that different distributions
are used, such as the poisson and the negative binomial
distributions [1].
The statistic take on predicting football matches is widely
used for increasing the betting chances of the user, however ,
the algorithm also requires training the machine. A database
is collected during the past years to have an analysis sample
for training and for validation. The bigger the percentage of
the data that is used for training, the better the system will

Andrade, Pablo: Mechanical engineering student


Cisneros, Jorge: Mechanical engineering student
Surez, Francisco: Mechanical engineering student

Goals scored by home team in its latest x


matches
Goals scored by away team in its latest x
matches
Goals conceded by home team in its latest x
matches
Goals conceded by away team in its latest x
matches
Average number of points gained by home
team in its latest x matches

Andrade, Pablo; Cisneros Jorge; Surez Francisco


_____________________________________________________________________________________________________________________________ __

Average number of points gained by away


team in its latest x matches

The x stands for the (variable) number of matches looked at.


The first four features are pretty straightforward, the last two
describe the points the home and away team gained in their
latest matches. These are calculated as in the football
competition itself, namely, 3 points for a win, 1 for a draw and
0 for a loss. The average over the latest x matches is taken. By
importing the features in Weka and letting several machine
learning algorithms classify the data as described in Section
1.3, a percentage of correctly predicted instances is given.
Now that an optimal number of matches to be considered has
been found, we can move on to selecting the best possible
classifier (machine learning algorithm). These will by means
of a certain machine learning algorithm classify all matches as
home wins, draws or away wins, depending on the features
belonging to that match. During the previous test round a
selection has already been made. Below is a list of seven
classifiers includi ng a short description of each one:

ClassificationViaRegression This algorithm


uses linear regression in order to predict the
right class.
MultiClassClassifier This algorithm is a lot
like ClassificationViaRegression, except that it
uses logistic regression instead of linear
regression.
RotationForest This algorithm uses a
decision tree to predict the right class.
LogitBoost This is a boosting algorithm that
alsouses logistic regression.
BayesNet This algorithm uses Bayesian
networks topredict the right class.
NaiveBayes This algorithm resembles
BayesNet, except
Home wins This algorithm will, regardless of
the feature set, always predict a home win.

In the previous section we have already seen that the first two
perform best, using the given simple feature s et. We now
expand our feature set by a few more features and make
several selections of them to see which classifier is best.
Please note that the home wins-classifier is used merely as
a reference. It can immediately be seen that this classifier
performs worse than all the others.
A Bayesian Network was used to predict the results of
Barcelona FC team in the Spanish League [3]. During the last
decade, Bayesian networks (and probabilistic graphical
models in general) have become very popular in artificial
intelligence. Bayesian networks (BNs) are graphical models
for reasoning under uncertainty, where the nodes represent
variables (discrete or continuous) and arcs represent direct
connections between them. These direct connections are
often causal connections. In addition, BNs model the

quantitative strength of the connections between variables,


allowing probabilistic beliefs about them to be updated
automatically as new information becomes available. A
Bayesian network for a set of variables X = {X1,..,Xn} consists
of:

1. A network structure S that encodes a set of


conditional independence assertions about
variables in X,
2. A set P of local probability distributions
associated with each variable. Together, these
components define the joint probability
distribution for X. The network structure Si s a
directed acyclic graph.
The BN used in the research of ref. [3] is as follows:

A neural network approach can be established to predict the


results of football matches. It is the case of ref. [4]. In that
work, the input and output variables were known, however
the hidden layer and weight distributions were not known.
Another way of obtaining the wanted results, a compound
approach can be adopted, as explained in ref. [5]. The authors
designed FRES (Football Result Expectation System), which
consists of two major components: a rule based reasoner and
a Bayesian network component. This approach is a compound
one in the sense that two different methods cooperate in
predicting the result of a football match.
The reasoning can be divided into two stages, strategymaking and result-calculating. Strategies include overlapping,
man-marking, pressing, position, and passing. The results
from Bayesian networks form the bases for these decisions.
Each team is assumed to have its own particular
characteristics, such as work rate, aggressiveness, pass
length, etc. Jess takes all these facets into consideration to
determine a strategy. As well as play-making strategies, the
system also reasons about higher-level decisions such as
substitutions and formation changes. The result calculating
part models the actual flow of a match. It models such aspects
as the effect of goals on morale, the effect of reputations,
relative scores, and locations on the state of the players. The
state changes throughout the match for example, perhaps
a teams morale is very good at one moment; if nothing
special happens for a long time then their morale can be
expected to converge to normal [5].

Predicting Football Matches using Neural Networks in MATLAB


_________________________________________________________________________________________________________________________

A Bayesian network, Bayes network, belief network,


Bayes(ian) model or probabilistic directed acyclic graphical
model is a probabilistic graphical model (a type of statistical
model) that represents a set of random variables and their
conditional dependencies via a directed acyclic graph (DAG).
For example, a Bayesian network could represent the
probabilistic relationships between diseases and symptoms.
Given symptoms, the network can be used to compute the
probabilities of the presence of various diseases [6].
WHAT
The project intends to create an artificial neural network
capable of predicting within a reasonable margin of error the
outcome of a football match during a specific season based
on statistical data from past seasons and performance ratings
from the players as well as the team as a whole when playing
against other team from the same league.

Cascade
Feed forward
Perceptron

These networks will be defined using the NNTOOL toolbox of


MATLAB.
The results of these simulations are shown in the next section.

2.3 Simulation
The simulation process consists in adding the statistics of the
last match and compare the simulation with the result in the
reality.

3 RESULTS
The results of the different networks are presented for LIGA
DE QUITO firstly.

3.1 LIGA DE QUITO

WHY

Mathematical and statistical challenge


The process needed to train an artificial neural
network can be implemented in other similar
applications
Advancing the artificial intelligence field.
Betting

3.1.1 Perceptron

2 METHODOLOGY
The team to be analysed will be LIGA DE QUITO this being the
last winners of the stage in the Ecuadorian Cup.
A neural network will be established for each team, taking in
account the statistics from 15 matches of the last season.
These
statistics
are
taken
from
http://www.futbolmetrics.com. [7]

2.1 Inputs.1.
2.
3.
4.
5.
6.

Shooting ratings
Effectivity ratings
Goalkeeper saves
Team defensive challenges won
Goals in favor
Goals against

2.2 Outputs.1.
2.
3.

Winning the match.


Drawing the match.
Losing the match.

The neural network methodology consists in establishing


three different types of network:

Andrade, Pablo; Cisneros Jorge; Surez Francisco


_____________________________________________________________________________________________________________________________ __

3.1.3 Cascade

3.1.2 Feed forward

Predicting Football Matches using Neural Networks in MATLAB


_________________________________________________________________________________________________________________________

3.2 SIMULATION
The statistics of the match taken in account are the ones of
the second match of the second season of the 2015, as shown
below [7].

However, the error in this network is null for predicting the


losses and the winnings.
In the simulation, this network did not predict accurately the
outcome of the test match, effectively, it shows a winning
score.

4.2 Feed forward


This network was implemented with 3 layers with 10 neurons
in the first and second layers.
The feed forward network begins with a large error, but the
training process reduces the error dramatically. Effectively,
the error in the last training was in the order of 4 10 10 .
The results of the training were proven to be very accurate
comparing with the target. There were no values that differed
with the expected results.

These simulations will be done in each neural network. The


combined results of these simulations are shown below.

In the simulation process, it is the only network that


accurately predicted the outcome, it predicted a draw (very
close to 1).

4.3 Cascade
This network showed a good trai ning process, a reduced error
in each training.
The error in the learning process turned out to be small for
the last training, in the order of 4 10 10 .
The expected result is a draw, i.e. a matrix as of:
[ 0; 0; 1]
The simulation that better suits the result is for the Feed
Forward network:
[. ; . ; . ]

The simulation result of this neural network was not


conclusive, since it didnt predict any outcome, the values of
drawing, losing and winning were 0.

4.4 Applications

4 DISCUSSION AND APPLICATIONS


4.1 Perceptron Network

This work can be applied with further refinement in the input


variables to predict the outcome of a football match.
Another application of this project can be in other sports.

The perceptron network is the simplest kind of network and


it has a better visual way of comparing the results. Effectively,
the perceptron network shows values of 1, 0 or -1. This makes
it easier to compare.
The training stage is also easier, however, the results did not
converge, and the network always reached the maximum
epoch without a conclusive result.
The error in predicting the result of drawing is large.

Andrade, Pablo; Cisneros Jorge; Surez Francisco


_____________________________________________________________________________________________________________________________ __

5 CONCLUSIONS AND
RECOMMENDATIONS

The best suited neural network for this project


is the Feed forward network, since it was the
one that learnt that scoring more goals than
those the team receives translates into winning
the match.
The perceptron network is not suited for this
kind of project, since it does not cope well with
drawings.
The cascade network is not good for this
project, since it does not predict any outcome.
The current network does not predict
accurately, since it needs the scored goals to
predict. Further variables are needed in order to
discard the goals from the inputs.

6 References
[1]

J. Goddard, Modelling football match results and the


efficiency of fixed-odds betting, Swansea: University of
Wales.

[2]

D. Buursma, Predicting sports events from past results,


Twente: University of Twente.

[3]

P. E. a. F. S. M. Farzin Owramipur, "Football Result


Prediction with Bayesian Network in Spanish LeagueBarcelona Team," vol. 5, no. 5, 2013.

[4]

[Online].
Available:
http://neuroph.sourceforge.net/tutorials/SportsPredi
ction/Premier%20League%20Prediction.html.

[5]

C. C. a. R. I. (. M. Byungho Min, "A Compound Approach


for Football Result Prediction," Seoul National
University, Seoul.

[6]

"Bayesian
network,"
[Online].
Available:
https://en.wikipedia.org/wiki/Bayesian_network.

[7]

"http://www.futbolmetrics.com/," [Online].

Вам также может понравиться