Web Application for Support in Basketball Game Analysis
Tomislav Horvat
1
, Ladislav Havaš
1
and Vladimir Medved
2
1
Department of Electrical Engineering, University North, 104. brigade 3, Varaždin, Croatia
2
Faculty of Kinesiology, University Zagreb, Zagreb, Croatia
Keywords: AssistantCoach, Basketball, Database Analysis, Expert System, ER Model, Web Application.
Abstract: The development of ICT technologies and usage in various fields enable faster development and analysis of
large amounts of data, but also a way of saving the data. Stored data are easier to search, edit and analyse.
Stored data, usually stored in databases, can be analysed and useful information can be drawn. As Internet
communication becomes the dominant way in exchange of data and information, many application and
expert system were developed. In this paper is shown AssistantCoach expert system, which was developed
for supporting basketball coaches in making decisions and analysing games. It describes a new algorithm
for game win percentage prediction and allows users to make notes about opponent players and teams, but
also notes about their own players, trainings and different types of game analysis. Based on input
parameters (IPE in selected time period, predicted parameters) the expert system calculates game win
percentage. By increasing or decreasing parameters, coaches are able to find the highest percentage for the
win and to use time before game to correct team mistakes. In addition to the algorithm for game win
percentage, the expert system offers their user a number of different analysis and statistics. Expert system
uses every input game boxscore and other notes as a new material to learn. Described methods and
algorithm are verified on a selected sample of basketball games and selected time period.
1 INTRODUCTION
Nowadays, the usage of computer analysis in sports,
especially in professional, has become a normal part
of the game analysis (Havaš et al., 2014). Statistical
analysis, also known as notational analysis, has
become interesting not only to coaches and sports
workers, but also to sports fans and reporters
(Hughes and Franks, 1997; Hughes and Franks,
2004). Mathematical presentation of a player's
performance can give a realistic image of player
performance and supports coaches to analyse
player's performance in a quick and easy way, very
often during a game or practice. The goal of the
game analysis is not to establish how good or bad
team or individual performance is, but to find and
correct common mistakes that will lead to increasing
of the individual performance and thus the team
performance. In every sport, especially team sports
like basketball, in which there is an individual or
team approach, using information and
communication technologies (ICT) enabled user's
(coaches, sport workers or sport fans) possibility to
analyse game on a different level (Dežman et al.,
2001). In a situation where there is an expert system
that has the ability to analyse player or team
performance and to extract useful information,
Internet communication becomes dominant among
users and the expert system (Havaš et al., 2013;
Havaš et al., 2013).
In this paper is shown one such expert system
that supports basketball coaches to analyse
individual or team performance in a game by using
web based application (Jackson, 1998; Leondes,
2002). The application can analyse team or player
performance before, during or after the game in real
time and supports coaches in making decisions.
Input data into the expert system’s database are
boxscores of played games, player notes, training
information and opponent notes.
The second part of this paper describes the expert
system architecture while the third part of the paper
shows the development of the expert system through
several stages of development. In the fourth part is
described and shown verification of results for a
selected time period. The final part of the paper
gives a conclusion and the list of references.
Horvat, T., Havaš, L. and Medved, V..
Web Application for Support in Basketball Game Analysis.
In Proceedings of the 3rd Inter national Congress on Sport Sciences Research and Technology Support (icSPORTS 2015), pages 225-231
ISBN: 978-989-758-159-5
Copyright
c
2015 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
225
2 AssistantCoach EXPERT
SYSTEM REPRESENTATION
The prototype of the expert system was developed
by using open-source programs (PHP and MySQL).
The whole application solution was programmed in
first object-oriented version of the language PHP,
version 5.4 (PHP, 2015). The database was designed
and implemented in MySQL relation database,
version 5.1.61 (MySQL, 2015).
2.1 The Architecture of an Expert
System
The first display which users of the prototype of
AssistantCoach application encounter is shown in
the Figure 1.
Figure 1: Opening display of AssistantCoach application
(log in the page).
Users can log in to the application as an
administrator, moderator or guest. The privilege to
add new users has only the administrator. The
moderator has limited privileges and can add new
games, boxscores, notes and can update information
about players. The guest can only see a schedule of
playing, boxscore of every game and player
individual average statistics. When the user has
successfully logged in, the user is presented with a
home page, in accordance with the authorization
level. A specific part of the application, functions or
menu items, is shown or hidden from the user. Home
page, which is shown after successful log in, gives
user the possibility to adjust the time period for
setting start and end date of every analysis.
AssistantCoach application consists of nine menu
items, including Home page, contained in the
navigation bar.
Menu item Players allows application users to
add, update or delete players, adding notes about
players, but also tracking players’ technical and
physical development.
Menu Games gives the user the possibility to add
new games, change the game result and to add
individual player performance during the game.
Menu Games also gives user the possibility to
analyse the game in order to compare with other
games in selected time period, but also a comparison
of players in selected time period. Very interesting
part of Games menu is the game prediction. Expert
system, based on user input parameters (predicted
game parameters and player’s minutes in play)
calculates the possibility for the win. Predicted
parameters are selected based on coach’s prediction,
based on opponent quality and current condition of
his team. Probability to win is calculated according
to the average player and team statistics of the
selected time period and the games against the
selected opponent. Menu Games also gives user the
possibility to make live statistics during the game
and possibility to compare current team and player
statistics to selected time period statistics. Statistics
can be analysed during the game.
Menu Statistics gives user all kinds of statistics
including IPE calculation which will be discussed in
later chapters. Menu Statistics also gives user the
possibility to define and save their own statistics,
according to their own view on the particular game
parameters.
Menu Opponents gives user the possibility to
make notes about opponent teams and players, while
Menu Reports gives user the possibility to make a
report about player in selected time period (average
numbers, notes, individual performance on every
game and training arrivals).
Menu Training gives user the possibility to make
records about every training and intensity of every
aspect of training, but also records about players and
their performance.
Menu About gives information about team staff
while Menu Fan Area behaves as a forum where
fans or reporters can leave their observations about
teams.
While AssistantCoach is Web based application
and authorization is needed, application
AssistantCoach can also behave as club Internet
page. Authorization level allows an administrator to
define the privileges of each user, thus the amount of
displayed information.
2.2 Input Data into Expert System
Input data into the expert system are game
boxscores, game result by minutes, notes about own
players, opponent players, opponent teams and
training information. Boxscore and result change by
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
226
minutes can be inserted into the database using form
Livestats or manually after the game, while all kind
of notes must be inserted manually. Segment of
livestats form is shown in the Figure 2.
Figure 2: Livestats form.
Expert system users can also make notes about
opponent teams or players, but also notes about
trainings and their own players. Notes can support
the coach in making decisions and can be used as a
reminder for previous played games or opponent
players. Flow chart of the expert system is shown in
the Figure 3.
Figure 3: Expert system flow chart.
2.3 The Index of Player Efficiency
(IPE)
Player efficiency index is a statistical data which
mathematically differently evaluates the basic
elements of the basketball game and thus
numerically evaluates the usefulness of a player in a
particular game or time period (Lidora and Arnon,
2000). Statistical analysis, like IPE, is a kind of
notational analysis. Notational analysis is basically
the gathering and analysing of data that has been
obtained by observing the performance of a team or
an individual in a competitive situation (Hoofler and
Payne, 1997; Karapidis et al., 2001). The staff
makes a list of measurable performance indicators as
a list of key elements of a match and then, based on
experience, the team or individual performance can
be evaluated mathematically using the appropriate
algorithm. One such algorithm is Index of Player
Efficiency (IPE).
The main advantage of IPE compared to other
known player efficiency indexes is the fact that IPE
makes players’ defensive activities equal to
attacking activities. Due to the fact that the average
basketball game viewer favours player's attacking
activities (dunks, buzzer beater shots, clutch
shots…) and basketball staff, especially coaches,
analysis of the whole player game, IPE makes
balance between offensive and defensive activities,
especially valuing above average contributions of an
individual in relation to the team. IPE algorithm
consists of a number of components where every
component represents a segment of the game
(points, rebounds, field goal percentage, steals,
turnovers, assists, fouls…). Every component of the
algorithm is then multiplied by particular factor.
Application AssistantCoach allows their users to
adjust the factors in the IPE algorithm according to
their wishes.
2.4 Game Prediction Algorithm
Various analysis and performance indicators have
allowed coaches to make faster and more efficient
analysis of a team or individual. Based on statistics
of previous games and time period selected by the
user, the system can draw useful information and
predict the percentage for the win. Coaches can
predict game parameters of scheduled game and
expert system will, based on statistics of previous
games, calculate percentage for the win. By
increasing or decreasing some parameters, coaches
are able to find the highest percentage for the win
and use time before game to correct team or
individual mistakes during the game.
Using decision trees application AssistantCoach
can predict the percentage for the win based on
predicted parameters and statistics of games played
in the selected time period. Decision tree learning is
a method usually used in data mining with a goal to
create a model that predicts the value of a target
Web Application for Support in Basketball Game Analysis
227
variable based on input data. Input data into
AssistantCoach application are boxscores of played
games.
The Application AssistantCoach uses decision
tree for every parameter of the game. The output of
one decision tree is input into another decision tree.
The initial percentage of victory is set to 50%.
Application AssistantCoach gives user the
possibility to set parameters according to users’
prediction. Parameters of prediction can be divided
into three groups:
predicted team parameters – predicted group
statistics of a particular game (team field goal
percentage, offensive and defensive rebounds,
steals, assists and turnovers)
individual parameters – predicted time in play
for every player
opponent team parameters – opponent team
name, venue, predicted opponent team quality in
relation to users’ team and number of opponent
team offensive rebounds
The application compares team average statistics in
the selected time period to users’ predicted numbers
and based on result increases or decreases the
percentage for the win. If some of the parameters
remain empty, the comparison for that particular
parameter is neglected. Predicted game form is
shown in the Figure 4.
Figure 4: Predict game form.
As it is shown in Figure 4, user predicts game
parameters, predicts minutes in play for every player
and predicts and defines opponent performance and
quality. Some parameters can remain empty or
unpredicted, a decision tree for the particular
parameter is skipped and the percentage for the win
remains unchanged. Basic game parameters (Game
parameters in the Figure 4) are calculated based on
average team performance in the selected time
period. Worse predicted parameters decrease
percentage for the win while better predicted
parameters increase percentage for the win. Based
on the ratio of predicted and average parameters, the
expert system defines coefficient, which is
multiplied by the current percentage for the win.
Current percentage for the win is output from
previous decision tree. The expert system also
analyses similar game parameters and based on
average and predicted performance also defines the
coefficient. As noted earlier, empty parameters do
not change the percentage and every parameter
makes one decision tree. Output of the decision tree
is input into another decision tree. Also, as noted
earlier, input into first decision tree is coefficient 0.5
or 50%. Prediction of more parameters and selecting
a longer time period, the expert system can more
accurately calculate the percentage for the win.
The second group of parameters, Players in the
game in the Figure 4, predicts minutes in play for
every player. The expert system, based on average
IPE which is introduced in the Chapter 2.3 the Index
of Player Efficiency (IPE), calculates coefficient
which is multiplied by the current percentage for the
win.
Last group of parameters, Opponents parameters
in the Figure 4, defines and predicts the opponent
quality and venue. The expert system, based on
results in the selected time period against the same
and other opponents, predicts opponent offensive
rebounds, opponent quality and venue calculate
coefficient which is then multiplied by the current
percentage for the win. The Figure 5 shows the
example of a decision tree where the coefficient for
assists is calculated. Based on the ratio between
predicted assists number and the average team
assists per game, the coefficient of the particular
ratio is multiplied with current win percentage
(w_perc). The output of assists decision tree is input
into steals decision tree. The decision tree is built for
every component. If predicted parameter remains
empty, the win percentage remains unchanged.
predictedassists/averageteamassists
coef=1,06 coef=1,03 coef=1 coef=0,97 coef=0,94
<1.3,
+>
<1.1,1.3] [0.9,1.1]
[0.7,0.9
>
<‐∞
,0.7
>
w_perc=w_perc+(coef1)*w_perc
predictedsteals/averageteamsteals
Figure 5: Decision tree for assists.
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
228
3 DEVELOPMENT OF THE
EXPERT SYSTEM
The development of an information system passes
through several stages of development; conceptual
design phase, implementation phase and phase of the
physical design. Conceptual design, also known as a
conceptual model, identifies the highest-level
relationships between different entities. Conceptual
model of the data is usually represented by ER
(Entity - Relationship) model which is a graphical
representation of entities and relationships among
them, typically used in computer sciences to present
the organization of data within databases and
information systems (Chen, 1976). ER model of the
expert system is given in the Figure 6.
GAME
PLAYER
plays
OPP_TEAM
plays
NOTES
TECHNICAL
_NOTES
is_for
is_for
OPP_TEAM
_NOTES
OPP_PLAYERS
is_for
is_for
OPP_PLAYER
_NOTES
plays
N
N
N
N
N
N
N
1
1
1
1
M
1
is_for
N
PHYSICAL
_NOTES
1
1
TRAINING attendts
NM
Figure 6: ER model of the expert system.
ER model in the Figure 6 shows the relationships
between entities in AssistantCoach application on
conceptual design phase. ER model says that the
game is played by more players and the player plays
more games. Every note, regardless if it is made for
a player or an opponent team is for one player or
team and player or opponent team can have more
notes. ER model in the Figure 6 also says that the
player attends more trainings and the training is
attended by more players (relationship between
entities TRAINING and PLAYER). Relation
OPP_PLAYERS – OPP_TEAM says that the player
plays for one team and in a team plays more players.
Creating an ER model completes the first phase of
the development of expert system. The next step in
the development of an expert system is the creation
of a logical model. The resulting ER model is
translated into a relational schema. Steps and
conversion rules for converting into relational model
are known from earlier. Relational model is then
implemented into the database management system.
The relational model of an expert system is shown in
the Figure 7.
OPP_PLAYER_NOTES
OPP_PLAYERS
OPP_TEAM
OPP_TEAM_NOTES
GAME PLAYERSTATISTICS
TRAINING
PLAYER_TRAINING
PHYSICAL_NOTES
TECHNICAL_NOTES
NOTES
IDPK
date
descripti
on
player_id
FK
ID
PK
nam e
surname
bir th_date
opp_tea m_
id
FK
IDPK
name
IDPK
date
des cription
opp_tea m_
id
FK
ID
PK
host_idFK
guest_idFK
date
result
ID
PK
name
surname
birth_dat
e
height
weight
player_id
FKPK
min
points
......
game_id
FKPK
f
ID
PK
date
descripti
on
player_id
FKPK
training_
id
FKPK
ID
PK
date
descripti
on
player_id
FK
ID
PK
date
des criptio
n
pla yer_id
FK
ID
PK
date
descripti
on
player_id
FK
Figure 7: Relational model of the expert system.
Expert system, Web based application
AssistantCoach, was developed with the purpose of
enabling the exchange of information in real time.
The application works on client-server architecture.
Client (user) sends a request to the server, which
passively waits, receives the request and sends a
response back to the client. The client can connect to
the Web page using a variety of devices that have
access to the Internet. The client sends a HTTP
request by writing the Web address into a Web
browser and Web server sends the answer back to
client. Architecture of Internet communication of
AssistantCoach application is shown in the Figure 8.
The developed expert system has been verified in
the selected time period. Games of the season
2014/2015 in Croatian 2nd basketball league were
analysed. For every game, team and individual
statistics were made, inserted into the database and
analysed by the developed expert system.
Web Application for Support in Basketball Game Analysis
229
(1)DNSrequest
(3)HTTPrequest
(4)Databaserequest
(2)DN Sreply
(5)Databa sere ply
(6)HTTPreply
Figure 8: Internet communication architecture.
Predictions were made based on average parameter
before the game was played, real parameters and no
parameter, just based on the team opponent name
and venue. The time period used for predictions was
whole 2014/2015, including friendly, Cup and
league games. Predictions were calculated for the
time period up to a match, while prediction based on
real parameters was calculated after the game was
played, also for time period up to a match. Table 1
shows game prediction of a league game of season
2014/2015. Columns colored in red show wrong
prediction.
4 RESULTS
As was mentioned earlier, Table 1 shows results
based on game prediction results during whole
2014/2015 season. Table 1 consists of five columns;
first column shows game date, the second column
shows the game result where prefix L means lost
game and prefix W means won game, the third
column shows win percentage based on average
parameters up to the game, the fourth column shows
game win percentage based on real game parameter
up to the game and the fifth column shows game win
percentage based only on opponent name and venue.
Fifth column gives prediction based only on
previous game against the same opponent and ratio
of win and lost games based on venue in selected
time period, so it is called “no parameter
prediction”. As is evident, time period and number
of played games significantly affect game prediction
algorithm. A greater amount of data in the database
reduces the possibility of extreme data which will be
included in the analysis.
Extreme data usually appear in the case of a
small sample data when the expert system does not
have enough data to learn and to extract useful
information. In the case of larger amounts of data
occurrence of extreme data is significantly decrease,
and thus analysis and game prediction percentage
more accurately. Based on the results from Table 1
and a sample of 21 matches and 63 predictions, it is
Table 1: Game prediction results.
DATE RESULT
AVERAGE
PARAMETER
PREDICTION
REAL PARAMETER
PREDICTION
NO PARAMETER
PREDICTION
11.10.2014. L 69:75 47% 42% 54%
18.10.2014. L 70:69 60% 43% 46%
26.10.2014. W 97:70 81% 71% 54%
2.11.2014. W 64:78 83% 79% 60%
8.11.2014. W 91:68 95% 49% 84%
15.11.2014. W 82:101 100% 100% 87%
22.11.2014. W 99:79 67% 78% 67%
29.11.2014. W 85:120 74% 100% 83%
6.12.2014. W 100:82 59% 91% 59%
14.12.2014. W 98:111 94% 85% 83%
19.12.2014. W 112:65 99% 100% 84%
11.1.2015. W 80:87 50% 59% 50%
18.1.2015. L 79:84 63% 53% 70%
31.1.2015. W 96:75 68% 75% 75%
7.2.2015. W 64:111 86% 94% 98%
14.2.2015. W 95:64 69% 67% 79%
21.2.2015. W 82:90 54% 81% 62%
28.2.2015. W 117:97 73% 100% 75%
8.3.2015. L 81:75 60% 45% 62%
13.3.2015. W 114:109 73% 91% 75%
22.3.2015. W 67:108 96% 100% 98%
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
230
clear that the game prediction algorithm was wrong
on 8 predictions. The biggest mistake is recorded for
the game played on 18.1.2015. The reason for this is
the fact that the match was played without five very
important players, players with the highest average
IPE.
5 CONCLUSIONS
This paper shows modelling of a Web based expert
system for support in basketball training and game
decisions. Expert system allows their user to easily
analyse basketball games or make good preparation
for upcoming games based on previous analysed
games or notes made about opponent teams or
players, but also previous played games. This paper
shows complete development of the expert system.
Game analysis is very complex matter. It takes years
of experience and knowledge to analyse game,
especially if it is made by hand. Developed expert
system supports coaches to analyse game on fast and
efficient way.
Second chapter presents expert system
architecture and shows expert system flow chart.
Input data into the database are boxscore and notes
about own players, opponent teams and opponent
players. Very interesting information about player
performance are player efficiency indexes. The
developed expert system uses IPE (Index of Player
Efficiency) index, statistical data which
mathematically differently evaluate basic elements
of basketball game and thus numerically evaluates
the usefulness of a player. The main advantage of
IPE compared to other known player efficiency
indexes is the fact that IPE makes players’ defensive
activities equal to attacking activities.
Expert system, based on IPE, previously played
games and predicted parameters, calculates game
win percentage prediction. By changing parameters
coaches are able to find the highest percentage for
the win and use time before game to correct team
mistakes. The initial percentage of victory is set to
50%. The Application AssistantCoach uses decision
tree for every parameter of the game, by increasing
or decreasing win percentage based on ration
between average and predicted parameter. The
output of one decision tree is input into another
decision tree. Parameters of prediction can be
divided into three groups; predicted team
parameters, individual player parameters and basic
opponent team parameters.
Third chapter presents the development of the
expert system through phases of conceptual and
logical phase. Conceptual model of the data is
represented by ER (Entity - Relationship) model
which is a graphical representation of entities and
relationships among them. The resulting ER model
is translated into a relational schema, which is
implemented into MySQL database. The application
works on client-server architecture.
Verification of the algorithms and the methods
has been conducted on a basketball 2014/2015
season.
REFERENCES
Chen, P., 1976. The Entity-Relationship Model -- Toward
a Unified View of Data. ACM Transactions on
Database Systems.
Dežman, B., Trninić, S., Dizdar, D., 2001. Expert model of
decision-making system for efficient orientation of
basketball players to positions and roles in the game-
empirical verification. Collegium Antropologicum.
Havaš, L., Medved, V., Skočir, Z., 2013. Application of
mobile technologies in the preparations for long
distance running. icSPORTS 2013.
Havaš, L., Medved, V., Skočir, Z., 2014. Machine
learning for individualized training support in
marathon running. icSPORTS 2014.
Havaš, L., Skočir, Z., Medved, V., 2013. Modeling of the
athlete's training decision support. Technical Gazette.
Hoofler, R., Payne, J., 1997. Measuring efficiency in the
national basket association. Econ lett.
Hughes, M., Franks, I.M., 2004. Notational Analysis of
Sport Systems for better coaching and performance in
sport. London: Routledge.
Hughes, M. D., Franks, I.M., 1997. Notational Analysis of
Sport. London: E. & F.N. Spon.
Hughes, M. D., Franks, I.M., 2004. Notational Analysis of
Sport 2nd Edition – better systems for improving
coaching and performance. London: E. & F.N. Spon.
Jackson, P., 1998. Introduction to Expert Systems (3 ed.).
Addison Wesley.
Karapidis, A, Fotinakis, A, Taxildaris, K., Fatouros, J.,
2001. Factors characterizing a successful
performance in basketball. J Hum Mov Stu.
Leondes, C. T., 2002. Expert systems: the technology of
knowledge management and decision making for the
21st century. Academic Press.
Lidor, R., Arnon, M., 2000. Developing indexes of
efficiency in basketball: talk with the coaches in their
own language. Kinesiology.
MySQL. Retrieved on April 15 2015 from
https://www.mysql.com/.
PHP. Retrieved on April 15 2015 from http://php.net/.
Web Application for Support in Basketball Game Analysis
231