4. In Game of thrones, it is highly likely that any character may die
in the next season. All of the GOT fans are always wondering
“Which of my favorite characters are going to meet their ends?”
The characters which is going to die next is “Unpredictable”
Problem Statement
5. Objective
• Predict who is going to die next using Network
Analysis
• Predict the battle wins using Network Analysis
Answers what we are looking for ?
• Which all kings and commanders have fought the
most number of battles?
• Who is most attacking king and commander? – Hub
• Which king and commander have been attacked the
most? – Authority
• What all types of communities are formed during the
analysis? – Community detection
7. Data of Thrones
character.csv -
contains information
about characters and
when they died.
01
battles.csv - The War
of the Five Kings
02
character-
predictions.csv -
contains character
deaths, including
predictions of how
likely they are to die
03
12. Model Building – Using Network Features
Data Pre-
processing
Nodes and Edges –
Using Character dataset
01
Features
Extraction
Centrality Measures
Degree, Eigen Vector
Centrality, Page Rank
02
Model Building
Random Forest
Classifier
03
Evaluation
Individual
Probabilities
04
13. Feature Extraction
Table 1: the set of features (based on network analysis) and the target variable (whether a certain character died) for
randomly selected characters.
Name ID male degree degree_std closeness closeness_std page_rank eigenvector eigen_centrality
Alys Arryn 1 0 2 0.009661836 0.000170561 8.24E-07 0.005098915 -0.000354421 0.001597952
Jasper Arryn 3 1 2 0.009661836 0.000176118 8.51E-07 0.004524229 -0.000354421 0.007076567
Jon Arryn 5 1 5 0.024154589 0.000181984 8.79E-07 0.009623742 -0.000886052 0.031264637
Lysa Arryn 6 0 5 0.024154589 0.000188005 9.08E-07 0.00813524 -0.000886052 0.097022091
Rowena Arryn 8 0 1 0.004830918 0.000175994 8.50E-07 0.00235719 -0.00017721 0.006732467
Cassana Baratheon 9 0 4 0.019323671 0.000190476 9.20E-07 0.005097146 -0.000708841 0.311475569
Cersei Lannister 10 0 6 0.028985507 0.000198491 9.59E-07 0.006628596 -0.001063262 0.916898001
Jaime Lannister 11 1 5 0.024154589 0.000197589 9.55E-07 0.005665075 -0.000886052 0.764286992
15. Goal
Our goal then is to relate network position to survival:
“Does one predict the other?”
In other words, we want to train an algorithm to figure out which network
measures predict whether a character has died.
18. Attacking King vs Defending King
Total Vertices 10
Total Edges 38
Network Density 0.844
Clustering co-efficient 0.2727
The Kings’ Circle
19. Attacking vs Defending Commander
Number of Vertices 90
Nodes 160
Density 0.039
Clustering co-efficient 0.399
The colors represent the Kings the Commanders belong to
The network of Commanders is less dense because
unlike kings there are many commanders and there is no
close knit network or repeated battles between same
commanders
However, higher CC than the Kings, implies a higher
chance a commander’s opponent commander is likely to
have fought with its neighboring commander
Commander vs Commander
20. Kings vs Kings Commander vs Commander
Commander Network id the scale free networkKings Network follows a power law distribution
21. Kings vs Kings: Which King has faced most battles??
NETWORK: node represents the degree
J/TB faced most number of battles
J/TB also seems to be most powerful an hence raging many
battles
22. Kings vs Kings:
J/TB - Joffrey/Tommen Baratheon is the
most attacking king
RS - Rob Stark is the king who was
most attacked
23. Kings vs Kings: Which the main groups of enemy Kings??
Walk Trap Community:
Communities with more edges within
community than between community
So here we see groups with most battles
within group than between groups
24. Commander vs Commander
Colors represent Kings
1) Commanders of J/TB in Red
2) Commanders of RS in Blue and
3) Commanders of SB in Pink
25. HUB – Who has been the most attacking commander?
• We see that the King in Pink, SB, Stannis
Baratheon has many commanders who have been on
the attacking the most number of times even when we
have J/TB Joffrey/Tommen Baratheon who is the
most attacking king
• This may mean J/TB keeps changing his
commanders or probably SB prefers to use the
same set of trusted commanders
26. Which commander has been attacked the most?
• Major Authorities belong to J/TB Joffrey/Tommen Baratheon even when J/TB is the most attacking King
and in purple colour, RB - Ranley Baratheon
27. Commander Vs Commander
More Battles with in Groups than between
groups
The two largest commander community is made up of
commanders of the HUB (J/TB) Joffrey/Tommen Baratheon
and the Authority King (RS) Robb Stark
The two largest walk trap Community
28. Similarity Analysis Between Commanders
Similarity derived on basis of :
• Total Battles
• Total Defends
• Kings they belong to
• Total Wins
The edges were weighted with the similarity
The range of Similarity is 1.47 to 9.31
• So we decide the to the most similar commanders
with similarity greater than 8.132
29. Clusters of most Similar Commanders
The Similarity Analysis and then clustering
using Walk-trap community we see 2 groups
emerging
Commanders Total Wins Total Losses
Total
Attacks
Total
battles
Total
Defends
Kings
Stannis Baratheon 9 4 8 13 5 Robb Stark
Renly Baratheon 0 2 0 2 2 Renly Baratheon
Cortnay Penrose 0 2 0 2 2 Renly Baratheon
Asha Greyjoy 0 2 0 2 2 Balon/Euron Greyjoy
Davos Seaworth 5 7 12 12 0 Stannis Baratheon
Loras Tyrell 0 2 0 2 2 Renly Baratheon
Randyll Tarly 5 1 0 6 6 Renly Baratheon
30. Can we predict the Battle Outcome Using the HUB and Authority Scores ?
• We considered using the Hub and Authority Scores to predict the outcome of the battle and considered the
following scenario.
• Algorithms Tried: Logistic Regression, SVM, Neural Net
• SVM was best model with highest Accuracy
Using Original Data
Y Battle Outcome (Win or Loss)
X1 Attacker Troop Size
X2 Defender Troop Size
X3 Total Attackers
X4 Total Defenders
Using the Hub and Authority Scores
Y Battle Outcome (Win or Loss)
X1 Att.King.hub
X2 Def.King.hub
X3 Att.King.auth
X4 Def.King.auth
X5 Att.Comm.hub
X6 Def.Comm.hub
X7 Att.Comm.auth
X8 Def.Comm.auth
Accuracy of 100%
Accuracy of 90%
Note: The data is very small only 38 battles. With only 5
losses hence even without the hub scores the original data
yielded more accurate results
31. Conclusion
• Community Detection with respect to the following categories are identified
o Characters
o Battles
• Key Players Detections – Characters, Battles
• Predicted which character is going to die next and also predicted the battle wins using
Network Analysis
• Hub and Authority Scores were not useful in prediction of the battle outcome
because the data of battles is very small (only 38 battles) without much variations
in outcome (only 5 Losses of the attacking side).
• This method can however prove useful with larger data with more variations
Further Discussion
Degree Centrality: the number of other characters that you interact with.
Weighted Degree Centrality: the number of interactions you participate in.
Eigenvector Centrality: weighted degree centrality with a feedback boost for interacting with other important characters. You get full credit for the importance of your neighbors.
PageRank Centrality: weighted degree centrality with a feedback boost for interacting with other important characters. The importance of your neighbors is split among its neighbors.
Closeness Centrality: the average distance to all other characters (measured by number of links you must traverse). For this measure only, smaller numbers are better.
Betweenness Centrality: how often you lie on shortest paths between two other characters, making you a broker of information.