Football¶
In this example, we use the football dataset to predict the outcomes of games between various teams. You can download the dataset here.
date: Date of the game.
home_team: Home Team.
home_score: Home Team number of goals.
away_team: Away Team.
away_score: Away Team number of goals.
tournament: Game Type (World Cup, Friendly…).
city: City where the game took place.
country: Country where the game took place.
neutral: If the event took place to a neutral location.
We will follow the data science cycle (Data Exploration - Data Preparation - Data Modeling - Model Evaluation - Model Deployment) to solve this problem.
Initialization¶
This example uses the following version of vastorbit:
import vastorbit as vo
vo.__version__
Connect to VAST. This example uses an existing connection called VASTDSN.
For details on how to create a connection, see the Connection tutorial.
You can skip the below cell if you already have an established connection.
vo.connect("VASTDSN")
Let’s create a VastFrame of the dataset.
football = vo.read_csv("games.csv")
football
📅 dateDate | Abc home_teamVarchar(50) | Abc away_teamVarchar(50) | 123 home_scoreInteger | 123 away_scoreInteger | Abc tournamentVarchar(50) | Abc cityVarchar(50) | Abc countryVarchar(50) | 0|1 neutralBoolean | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 1872-11-30 | Scotland | England | 0 | 0 | Friendly | Glasgow | Scotland | ✗ |
| 2 | 1873-03-08 | England | Scotland | 4 | 2 | Friendly | London | England | ✗ |
| 3 | 1874-03-07 | Scotland | England | 2 | 1 | Friendly | Glasgow | Scotland | ✗ |
| 4 | 1875-03-06 | England | Scotland | 2 | 2 | Friendly | London | England | ✗ |
| 5 | 1876-03-04 | Scotland | England | 3 | 0 | Friendly | Glasgow | Scotland | ✗ |
| 6 | 1876-03-25 | Scotland | Wales | 4 | 0 | Friendly | Glasgow | Scotland | ✗ |
| 7 | 1877-03-03 | England | Scotland | 1 | 3 | Friendly | London | England | ✗ |
| 8 | 1877-03-05 | Wales | Scotland | 0 | 2 | Friendly | Wrexham | Wales | ✗ |
| 9 | 1878-03-02 | Scotland | England | 7 | 2 | Friendly | Glasgow | Scotland | ✗ |
| 10 | 1878-03-23 | Scotland | Wales | 9 | 0 | Friendly | Glasgow | Scotland | ✗ |
| 11 | 1879-01-18 | England | Wales | 2 | 1 | Friendly | London | England | ✗ |
| 12 | 1879-04-05 | England | Scotland | 5 | 4 | Friendly | London | England | ✗ |
| 13 | 1879-04-07 | Wales | Scotland | 0 | 3 | Friendly | Wrexham | Wales | ✗ |
| 14 | 1880-03-13 | Scotland | England | 5 | 4 | Friendly | Glasgow | Scotland | ✗ |
| 15 | 1880-03-15 | Wales | England | 2 | 3 | Friendly | Wrexham | Wales | ✗ |
| 16 | 1880-03-27 | Scotland | Wales | 5 | 1 | Friendly | Glasgow | Scotland | ✗ |
| 17 | 1881-02-26 | England | Wales | 0 | 1 | Friendly | Blackburn | England | ✗ |
| 18 | 1881-03-12 | England | Scotland | 1 | 6 | Friendly | London | England | ✗ |
| 19 | 1881-03-14 | Wales | Scotland | 1 | 5 | Friendly | Wrexham | Wales | ✗ |
| 20 | 1882-02-18 | Northern Ireland | England | 0 | 13 | Friendly | Belfast | Republic of Ireland | ✗ |
Data Exploration and Preparation¶
Let’s explore the data by displaying descriptive statistics of all the columns.
football["date"].describe()
| value | |
|---|---|
| name | "date" |
| dtype | date |
| count | 41586 |
| min | 1872-11-30 |
| max | 2020-02-01 |
The dataset includes a total of 41,586 games, which take place between 1872 and 2020. Let’s look at our game types and teams.
football["tournament"].describe()
| value | |
|---|---|
| name | "tournament" |
| dtype | varchar(50) |
| unique | 112.0 |
| count | 41586.0 |
| Friendly | 17029 |
| Others | 10630 |
| FIFA World Cup qualification | 7236 |
| UEFA Euro qualification | 2582 |
| African Cup of Nations qualification | 1672 |
| FIFA World Cup | 900 |
| Copa América | 813 |
Different types of tournaments took place (FIFA World Cup, UEFA Euro, etc.) aand most of the games in our data are friendlies or qualifiers for international tournaments.
football.describe()
| count | mean | std | min | approx_25% | approx_50% | approx_75% | max | |
|---|---|---|---|---|---|---|---|---|
| "home_score" | 41586.0 | 1.745755783196268 | 1.753780340476994 | 0.0 | 1.0 | 1.0 | 2.0 | 31.0 |
| "away_score" | 41586.0 | 1.187587168758717 | 1.4053234683358853 | 0.0 | 0.0 | 1.0 | 2.0 | 21.0 |
| "neutral" | 41586.0 | 0.24724666955225316 | 0.43141653827564974 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 |
football.describe(method = "categorical")
| dtype | count | top | top_percent | |
|---|---|---|---|---|
| "date" | date | 41586 | 2012-02-29 | 0.159 |
| "home_team" | varchar(50) | 41586 | Brazil | 1.366 |
| "away_team" | varchar(50) | 41586 | Uruguay | 1.301 |
| "home_score" | integer | 41586 | 1 | 29.57 |
| "away_score" | integer | 41586 | 0 | 37.135 |
| "tournament" | varchar(50) | 41586 | Friendly | 40.949 |
| "city" | varchar(50) | 41586 | Kuala Lumpur | 1.416 |
| "country" | varchar(50) | 41586 | United States | 2.787 |
| "neutral" | boolean | 41586 | ✗ | 75.275 |
The dataset includes 308 national teams. For most of the games, the home team scores better than the away team. Since some games take place in a neutral location, we can ensure this hypothesis using the variable neutral. Notice also that the number of goals per match is pretty low (median of 1 for both away and home teams).
Goal¶
Our goal for the study will be to predict the outcomes of games after 2015. Before doing the study, we can notice that some teams names have changed over time. We need to change the old names by the new names otherwise it will add too much bias in the data.
for team in ["home_team", "away_team"]:
football[team].decode(
'German DR', 'Germany',
'Czechoslovakia', 'Czech Republic',
'Yugoslavia', 'Serbia',
'Yemen DPR', 'Yemen',
football[team],
)
Let’s just consider teams that have played more than five home and away games.
football["cnt_games_1"] = "COUNT(*) OVER (PARTITION BY home_team)"
football["cnt_games_2"] = "COUNT(*) OVER (PARTITION BY away_team)"
football.filter((football["cnt_games_2"] > 5) & (football["cnt_games_1"] > 5))
vo.drop("football_clean", method = "table")
football.to_db(
name = "football_clean",
usecols = [
"date",
"home_score",
"home_team",
"tournament",
"away_team",
"away_score",
"neutral",
"country",
"city",
],
relation_type = "table",
inplace = True,
)
📅 dateDate | 123 home_scoreInteger | Abc home_teamVarchar(50) | Abc tournamentVarchar(50) | Abc away_teamVarchar(50) | 123 away_scoreInteger | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 1993-12-16 | 0 | Mexico | Friendly | Brazil | 1 | ✗ | Mexico | Guadalajara |
| 2 | 2009-06-21 | 0 | Italy | Confederations Cup | Brazil | 3 | ✓ | South Africa | Pretoria |
| 3 | 2011-11-10 | 0 | Gabon | Friendly | Brazil | 2 | ✗ | Gabon | Libreville |
| 4 | 2017-10-05 | 0 | Bolivia | FIFA World Cup qualification | Brazil | 0 | ✗ | Bolivia | La Paz |
| 5 | 1979-08-23 | 2 | Argentina | Copa América | Brazil | 2 | ✗ | Argentina | Buenos Aires |
| 6 | 2005-10-09 | 1 | Bolivia | FIFA World Cup qualification | Brazil | 1 | ✗ | Bolivia | La Paz |
| 7 | 1959-03-21 | 2 | Bolivia | Copa América | Brazil | 4 | ✓ | Argentina | Buenos Aires |
| 8 | 1988-07-17 | 0 | Australia | Friendly | Brazil | 2 | ✗ | Australia | Sydney |
| 9 | 1997-12-14 | 0 | Australia | Confederations Cup | Brazil | 0 | ✓ | Saudi Arabia | Riyadh |
| 10 | 2017-06-13 | 0 | Australia | Friendly | Brazil | 4 | ✗ | Australia | Melbourne |
| 11 | 1987-07-03 | 4 | Chile | Copa América | Brazil | 0 | ✓ | Argentina | Córdoba |
| 12 | 1988-07-07 | 0 | Australia | Friendly | Brazil | 1 | ✗ | Australia | Melbourne |
| 13 | 1985-05-21 | 2 | Chile | Friendly | Brazil | 1 | ✗ | Chile | Santiago |
| 14 | 1957-09-15 | 1 | Chile | Copa Bernardo O'Higgins | Brazil | 0 | ✗ | Chile | Santiago |
| 15 | 2001-06-09 | 1 | Australia | Confederations Cup | Brazil | 0 | ✓ | South Korea | Ulsan |
| 16 | 1957-09-18 | 1 | Chile | Copa Bernardo O'Higgins | Brazil | 1 | ✗ | Chile | Santiago |
| 17 | 1999-07-14 | 0 | Mexico | Copa América | Brazil | 2 | ✓ | Paraguay | Ciudad del Este |
| 18 | 2000-08-15 | 3 | Chile | FIFA World Cup qualification | Brazil | 0 | ✗ | Chile | Santiago |
| 19 | 2013-10-12 | 0 | South Korea | Friendly | Brazil | 2 | ✗ | South Korea | Seoul |
| 20 | 2006-08-16 | 1 | Norway | Friendly | Brazil | 1 | ✗ | Norway | Oslo |
A lot of things could influence the outcome of a game. Since we only have access to the score, teams, and type of game, we can’t consider external factors like, weather or temperature, which would otherwise help our prediction.
To create a good model using this dataset, we could compute each team’s key performance indicator (KPI), ranking (clusters computed using the number of games in important tournaments like the World Cup, the percentage of victory…), shape (moving windows using the last games information), and other factors.
Here’s our plan: - Identify cup winners - Rank the teams with clustering - Compute teams’ KPIs - Create a machine learning model
Data Preparation for Clustering¶
To create clusters, we need to find which teams are the winners of main tournaments (mainly the World Cups and Continental Cups). Since all tournaments took place the same year, we could partition by tournament and year to identify the last game of the tournament.
We’ll ignore ties for our analysis since there’s no way to determine a winner.
Cup Winner¶
Let’s start by creating the feature winner to indicate the winner of a game.
import vastorbit.sql.functions as fun
football.filter(fun.year(football["date"]) <= 2015)
football.case_when(
"winner",
football["home_score"] > football["away_score"], football["home_team"],
football["home_score"] < football["away_score"], football["away_team"],
None,
)
📅 dateDate | 123 home_scoreInteger | Abc home_teamVarchar(50) | Abc tournamentVarchar(50) | Abc away_teamVarchar(50) | 123 away_scoreInteger | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc winnerVarchar(50) | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1993-12-16 | 0 | Mexico | Friendly | Brazil | 1 | ✗ | Mexico | Guadalajara | Brazil |
| 2 | 2009-06-21 | 0 | Italy | Confederations Cup | Brazil | 3 | ✓ | South Africa | Pretoria | Brazil |
| 3 | 2011-11-10 | 0 | Gabon | Friendly | Brazil | 2 | ✗ | Gabon | Libreville | Brazil |
| 4 | 1979-08-23 | 2 | Argentina | Copa América | Brazil | 2 | ✗ | Argentina | Buenos Aires | [null] |
| 5 | 2005-10-09 | 1 | Bolivia | FIFA World Cup qualification | Brazil | 1 | ✗ | Bolivia | La Paz | [null] |
| 6 | 1959-03-21 | 2 | Bolivia | Copa América | Brazil | 4 | ✓ | Argentina | Buenos Aires | Brazil |
| 7 | 1988-07-17 | 0 | Australia | Friendly | Brazil | 2 | ✗ | Australia | Sydney | Brazil |
| 8 | 1997-12-14 | 0 | Australia | Confederations Cup | Brazil | 0 | ✓ | Saudi Arabia | Riyadh | [null] |
| 9 | 1987-07-03 | 4 | Chile | Copa América | Brazil | 0 | ✓ | Argentina | Córdoba | Chile |
| 10 | 1988-07-07 | 0 | Australia | Friendly | Brazil | 1 | ✗ | Australia | Melbourne | Brazil |
| 11 | 1985-05-21 | 2 | Chile | Friendly | Brazil | 1 | ✗ | Chile | Santiago | Chile |
| 12 | 1957-09-15 | 1 | Chile | Copa Bernardo O'Higgins | Brazil | 0 | ✗ | Chile | Santiago | Chile |
| 13 | 2001-06-09 | 1 | Australia | Confederations Cup | Brazil | 0 | ✓ | South Korea | Ulsan | Australia |
| 14 | 1957-09-18 | 1 | Chile | Copa Bernardo O'Higgins | Brazil | 1 | ✗ | Chile | Santiago | [null] |
| 15 | 1999-07-14 | 0 | Mexico | Copa América | Brazil | 2 | ✓ | Paraguay | Ciudad del Este | Brazil |
| 16 | 2000-08-15 | 3 | Chile | FIFA World Cup qualification | Brazil | 0 | ✗ | Chile | Santiago | Chile |
| 17 | 2013-10-12 | 0 | South Korea | Friendly | Brazil | 2 | ✗ | South Korea | Seoul | Brazil |
| 18 | 2006-08-16 | 1 | Norway | Friendly | Brazil | 1 | ✗ | Norway | Oslo | [null] |
| 19 | 1988-07-28 | 1 | Norway | Friendly | Brazil | 1 | ✗ | Norway | Oslo | [null] |
| 20 | 1995-08-12 | 0 | South Korea | Friendly | Brazil | 1 | ✗ | South Korea | Suwon | Brazil |
Let’s analyze the last game of each tournament.
football["year"] = fun.year(football["date"])
football.analytic(
"row_number",
order_by = {"date": "desc"},
by = ["tournament", "year"] ,
name = "order_tournament",
)
📅 dateDate | 123 home_scoreInteger | Abc home_teamVarchar(50) | Abc tournamentVarchar(50) | Abc away_teamVarchar(50) | 123 away_scoreInteger | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc winnerVarchar(50) | 123 yearBigint | 123 order_tournamentBigint | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1998-12-27 | 1 | Kuwait | Friendly | Egypt | 1 | ✗ | Kuwait | Kuwait City | [null] | 1998 | 1 |
| 2 | 1998-12-23 | 2 | Israel | Friendly | Serbia | 0 | ✗ | Israel | Ramat-Gan | Israel | 1998 | 2 |
| 3 | 1998-12-22 | 5 | Basque Country | Friendly | Uruguay | 1 | ✗ | Spain | San Sebastián | Basque Country | 1998 | 3 |
| 4 | 1998-12-22 | 5 | Catalonia | Friendly | Nigeria | 0 | ✗ | Spain | Barcelona | Catalonia | 1998 | 4 |
| 5 | 1998-12-16 | 2 | South Africa | Friendly | Egypt | 1 | ✗ | South Africa | Johannesburg | South Africa | 1998 | 5 |
| 6 | 1998-12-06 | 0 | British Virgin Islands | Friendly | Saint Vincent and the Grenadines | 5 | ✗ | British Virgin Islands | Road Town | Saint Vincent and the Grenadines | 1998 | 6 |
| 7 | 1998-12-03 | 0 | Mali | Friendly | Ghana | 2 | ✗ | Mali | Bamako | Ghana | 1998 | 7 |
| 8 | 1998-12-02 | 3 | United Arab Emirates | Friendly | North Korea | 3 | ✓ | Thailand | Songkhla | [null] | 1998 | 8 |
| 9 | 1998-11-28 | 2 | Azerbaijan | Friendly | Estonia | 1 | ✗ | Azerbaijan | Gəncə | Azerbaijan | 1998 | 9 |
| 10 | 1998-11-27 | 2 | Thailand | Friendly | Nepal | 0 | ✗ | Thailand | Bangkok | Thailand | 1998 | 10 |
| 11 | 1998-11-25 | 0 | Singapore | Friendly | United Arab Emirates | 4 | ✗ | Singapore | Singapore | United Arab Emirates | 1998 | 11 |
| 12 | 1998-11-22 | 0 | China PR | Friendly | South Korea | 0 | ✗ | China PR | Shanghai | [null] | 1998 | 12 |
| 13 | 1998-11-21 | 2 | Armenia | Friendly | Estonia | 1 | ✗ | Armenia | Abovyan | Armenia | 1998 | 13 |
| 14 | 1998-11-21 | 3 | Thailand | Friendly | Turkmenistan | 3 | ✗ | Thailand | Bangkok | [null] | 1998 | 14 |
| 15 | 1998-11-19 | 0 | India | Friendly | Uzbekistan | 4 | ✗ | India | Calcutta | Uzbekistan | 1998 | 15 |
| 16 | 1998-11-19 | 1 | Hong Kong | Friendly | Vietnam | 1 | ✗ | Hong Kong | Victoria | [null] | 1998 | 16 |
| 17 | 1998-11-18 | 2 | Hungary | Friendly | Switzerland | 0 | ✗ | Hungary | Budapest | Hungary | 1998 | 17 |
| 18 | 1998-11-18 | 1 | El Salvador | Friendly | Honduras | 2 | ✓ | United States | Los Angeles | Honduras | 1998 | 18 |
| 19 | 1998-11-18 | 5 | Brazil | Friendly | Russia | 1 | ✗ | Brazil | Fortaleza | Brazil | 1998 | 19 |
| 20 | 1998-11-18 | 2 | England | Friendly | Czech Republic | 0 | ✗ | England | London | England | 1998 | 20 |
We can filter the data by only considering the last games and top tournaments.
football.filter(
conditions = [
football["order_tournament"] == 1,
football["winner"] != None,
football["tournament"]._in(
[
"FIFA World Cup",
"UEFA Euro",
"Copa América",
"African Cup of Nations",
"AFC Asian Cup",
"Gold Cup",
]
)
]
)
📅 dateDate | 123 home_scoreInteger | Abc home_teamVarchar(50) | Abc tournamentVarchar(50) | Abc away_teamVarchar(50) | 123 away_scoreInteger | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc winnerVarchar(50) | 123 yearBigint | 123 order_tournamentBigint | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1988-06-25 | 0 | Russia | UEFA Euro | Netherlands | 2 | ✓ | Germany | Munich | Netherlands | 1988 | 1 |
| 2 | 2009-07-26 | 0 | United States | Gold Cup | Mexico | 5 | ✗ | United States | East Rutherford | Mexico | 2009 | 1 |
| 3 | 1996-02-03 | 2 | South Africa | African Cup of Nations | Tunisia | 0 | ✗ | South Africa | Johannesburg | South Africa | 1996 | 1 |
| 4 | 1962-01-21 | 4 | Ethiopia | African Cup of Nations | Egypt | 2 | ✗ | Ethiopia | Addis Abeba | Ethiopia | 1962 | 1 |
| 5 | 1941-03-04 | 0 | Chile | Copa América | Argentina | 1 | ✗ | Chile | Santiago | Argentina | 1941 | 1 |
| 6 | 2007-07-15 | 3 | Brazil | Copa América | Argentina | 0 | ✓ | Venezuela | Maracaibo | Brazil | 2007 | 1 |
| 7 | 1970-02-16 | 3 | Egypt | African Cup of Nations | Ivory Coast | 1 | ✓ | Sudan | Khartoum | Egypt | 1970 | 1 |
| 8 | 1947-12-31 | 3 | Bolivia | Copa América | Chile | 4 | ✓ | Ecuador | Guayaquil | Chile | 1947 | 1 |
| 9 | 1959-12-25 | 3 | Ecuador | Copa América | Paraguay | 1 | ✗ | Ecuador | Guayaquil | Ecuador | 1959 | 1 |
| 10 | 1980-09-30 | 3 | Kuwait | AFC Asian Cup | South Korea | 0 | ✗ | Kuwait | Kuwait City | Kuwait | 1980 | 1 |
| 11 | 1958-06-29 | 2 | Sweden | FIFA World Cup | Brazil | 5 | ✗ | Sweden | Solna | Brazil | 1958 | 1 |
| 12 | 1978-03-16 | 2 | Nigeria | African Cup of Nations | Tunisia | 0 | ✓ | Ghana | Accra | Nigeria | 1978 | 1 |
| 13 | 1942-02-07 | 1 | Uruguay | Copa América | Argentina | 0 | ✗ | Uruguay | Montevideo | Uruguay | 1942 | 1 |
| 14 | 2002-02-02 | 2 | Canada | Gold Cup | South Korea | 1 | ✓ | United States | Pasadena | Canada | 2002 | 1 |
| 15 | 1939-02-12 | 2 | Peru | Copa América | Uruguay | 1 | ✗ | Peru | Lima | Peru | 1939 | 1 |
| 16 | 2001-07-29 | 1 | Colombia | Copa América | Mexico | 0 | ✗ | Colombia | Bogotá | Colombia | 2001 | 1 |
| 17 | 1990-07-08 | 1 | Germany | FIFA World Cup | Argentina | 0 | ✓ | Italy | Rome | Germany | 1990 | 1 |
| 18 | 2013-02-10 | 1 | Nigeria | African Cup of Nations | Burkina Faso | 0 | ✓ | South Africa | Johannesburg | Nigeria | 2013 | 1 |
| 19 | 1982-07-11 | 3 | Italy | FIFA World Cup | Germany | 1 | ✓ | Spain | Madrid | Italy | 1982 | 1 |
| 20 | 1965-11-21 | 1 | Ivory Coast | African Cup of Nations | Senegal | 0 | ✓ | Tunisia | Tunis | Ivory Coast | 1965 | 1 |
Let’s consider the World Cup as a special tournament. It is the only one where the confrontations between the top teams is possible.
football["Word_Cup"] = fun.decode(
football["tournament"], "FIFA World Cup",
1, 0,
)
football["Word_Cup"]
123 Word_CupInteger | |
|---|---|
| 1 | 0 |
| 2 | 0 |
| 3 | 0 |
| 4 | 0 |
| 5 | 0 |
| 6 | 0 |
| 7 | 0 |
| 8 | 0 |
| 9 | 0 |
| 10 | 0 |
| 11 | 1 |
| 12 | 0 |
| 13 | 0 |
| 14 | 1 |
| 15 | 0 |
| 16 | 0 |
| 17 | 1 |
| 18 | 0 |
| 19 | 0 |
| 20 | 0 |
We can compute all the number of cup-wins by team. As expected, Brazil and Germany are the top football teams.
agg = [
fun.sum(football["Word_Cup"])._as("nb_World_Cup"),
fun.sum(1 - football["Word_Cup"])._as("nb_Continental_Cup"),
]
football_cup_winners = football.groupby(["winner"], agg)
football_cup_winners.sort(
{
"nb_World_Cup": "desc",
"nb_Continental_Cup": "desc",
}
).head(10)
Abc winnerVarchar(50) | 123 nb_World_CupBigint | 123 nb_Continental_CupBigint | |
|---|---|---|---|
| 1 | Brazil | 4 | 9 |
| 2 | Germany | 4 | 3 |
| 3 | Italy | 3 | 1 |
| 4 | Uruguay | 2 | 8 |
| 5 | Argentina | 2 | 8 |
| 6 | Spain | 1 | 3 |
| 7 | France | 1 | 2 |
| 8 | England | 1 | 0 |
| 9 | Mexico | 0 | 6 |
| 10 | Egypt | 0 | 6 |
Let’s export the result to our VAST DataBase.
vo.drop(
"football_cup_winners",
method = "table",
)
football_cup_winners.to_db(
"football_cup_winners",
relation_type = "table",
)
Abc winnerVarchar(50) | 123 nb_World_CupBigint | 123 nb_Continental_CupBigint | |
|---|---|---|---|
| 1 | Brazil | 4 | 10 |
| 2 | Germany | 4 | 3 |
| 3 | Italy | 3 | 1 |
| 4 | Uruguay | 2 | 8 |
| 5 | Argentina | 2 | 8 |
| 6 | Spain | 1 | 3 |
| 7 | France | 1 | 2 |
| 8 | England | 1 | 0 |
| 9 | Mexico | 0 | 6 |
| 10 | Egypt | 0 | 6 |
| 11 | Ivory Coast | 0 | 3 |
| 12 | Peru | 0 | 3 |
| 13 | United States | 0 | 3 |
| 14 | Japan | 0 | 3 |
| 15 | Nigeria | 0 | 3 |
| 16 | Paraguay | 0 | 2 |
| 17 | South Korea | 0 | 2 |
| 18 | Ghana | 0 | 2 |
| 19 | Iran | 0 | 2 |
| 20 | Cameroon | 0 | 2 |
Team Confederations¶
Looking into team confederations could help our analysis. For example, this might help us quantify skill differences between different continents. A team that had played a qualification of a specific location can only belong to that tournament confederation.
First let’s encode the different continents so we can compute the correct aggregations.
football = vo.read_csv("games.csv")
football.case_when(
'confederation',
football["tournament"] == 'UEFA Euro qualification', 5,
football["tournament"] == 'African Cup of Nations qualification', 4,
football["tournament"] == 'AFC Asian Cup qualification', 3,
football["tournament"] == 'Copa América', 2,
football["tournament"] == 'Gold Cup', 1, 0,
)
📅 dateDate | Abc home_teamVarchar(50) | Abc away_teamVarchar(50) | 123 home_scoreInteger | 123 away_scoreInteger | Abc tournamentVarchar(50) | Abc cityVarchar(50) | Abc countryVarchar(50) | 0|1 neutralBoolean | 123 confederationInteger | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1872-11-30 | Scotland | England | 0 | 0 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 2 | 1873-03-08 | England | Scotland | 4 | 2 | Friendly | London | England | ✗ | 0 |
| 3 | 1874-03-07 | Scotland | England | 2 | 1 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 4 | 1875-03-06 | England | Scotland | 2 | 2 | Friendly | London | England | ✗ | 0 |
| 5 | 1876-03-04 | Scotland | England | 3 | 0 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 6 | 1876-03-25 | Scotland | Wales | 4 | 0 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 7 | 1877-03-03 | England | Scotland | 1 | 3 | Friendly | London | England | ✗ | 0 |
| 8 | 1877-03-05 | Wales | Scotland | 0 | 2 | Friendly | Wrexham | Wales | ✗ | 0 |
| 9 | 1878-03-02 | Scotland | England | 7 | 2 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 10 | 1878-03-23 | Scotland | Wales | 9 | 0 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 11 | 1879-01-18 | England | Wales | 2 | 1 | Friendly | London | England | ✗ | 0 |
| 12 | 1879-04-05 | England | Scotland | 5 | 4 | Friendly | London | England | ✗ | 0 |
| 13 | 1879-04-07 | Wales | Scotland | 0 | 3 | Friendly | Wrexham | Wales | ✗ | 0 |
| 14 | 1880-03-13 | Scotland | England | 5 | 4 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 15 | 1880-03-15 | Wales | England | 2 | 3 | Friendly | Wrexham | Wales | ✗ | 0 |
| 16 | 1880-03-27 | Scotland | Wales | 5 | 1 | Friendly | Glasgow | Scotland | ✗ | 0 |
| 17 | 1881-02-26 | England | Wales | 0 | 1 | Friendly | Blackburn | England | ✗ | 0 |
| 18 | 1881-03-12 | England | Scotland | 1 | 6 | Friendly | London | England | ✗ | 0 |
| 19 | 1881-03-14 | Wales | Scotland | 1 | 5 | Friendly | Wrexham | Wales | ✗ | 0 |
| 20 | 1882-02-18 | Northern Ireland | England | 0 | 13 | Friendly | Belfast | Republic of Ireland | ✗ | 0 |
We can aggregate the data and get each team’s continent.
confederation = football.groupby(
["home_team"],
[fun.max(football["confederation"])._as("confederation")],
)
confederation.head(100)
Abc home_teamVarchar(50) | 123 confederationInteger | |
|---|---|---|
| 1 | Niger | 4 |
| 2 | Iceland | 5 |
| 3 | Honduras | 2 |
| 4 | South Korea | 3 |
| 5 | New Zealand | 0 |
| 6 | Sudan | 4 |
| 7 | Saint Lucia | 0 |
| 8 | Ecuador | 2 |
| 9 | Catalonia | 0 |
| 10 | Gambia | 4 |
| 11 | Nepal | 3 |
| 12 | Manchukuo | 0 |
| 13 | Isle of Man | 0 |
| 14 | Eritrea | 4 |
| 15 | Saint Pierre and Miquelon | 0 |
| 16 | Felvidék | 0 |
| 17 | Namibia | 4 |
| 18 | Japan | 3 |
| 19 | Corsica | 0 |
| 20 | Moldova | 5 |
| 21 | Iraqi Kurdistan | 0 |
| 22 | Albania | 5 |
| 23 | Luxembourg | 5 |
| 24 | Bosnia and Herzegovina | 5 |
| 25 | Senegal | 4 |
| 26 | Thailand | 3 |
| 27 | Guatemala | 1 |
| 28 | Liberia | 4 |
| 29 | United Arab Emirates | 3 |
| 30 | Syria | 3 |
| 31 | Montserrat | 0 |
| 32 | Comoros | 4 |
| 33 | Hong Kong | 3 |
| 34 | Samoa | 0 |
| 35 | Shetland | 0 |
| 36 | Falkland Islands | 0 |
| 37 | South Sudan | 4 |
| 38 | United Koreans in Japan | 0 |
| 39 | Tamil Eelam | 0 |
| 40 | Kabylia | 0 |
| 41 | Madrid | 0 |
| 42 | Sark | 0 |
| 43 | Paraguay | 2 |
| 44 | Croatia | 5 |
| 45 | England | 5 |
| 46 | Portugal | 5 |
| 47 | Greece | 5 |
| 48 | Ukraine | 5 |
| 49 | Belarus | 5 |
| 50 | Saudi Arabia | 3 |
| 51 | Bahrain | 3 |
| 52 | North Macedonia | 5 |
| 53 | Palestine | 3 |
| 54 | East Timor | 0 |
| 55 | Pakistan | 3 |
| 56 | Bangladesh | 3 |
| 57 | Solomon Islands | 0 |
| 58 | Menorca | 0 |
| 59 | Wallis Islands and Futuna | 0 |
| 60 | Romani people | 0 |
| 61 | Palau | 0 |
| 62 | Yemen | 3 |
| 63 | Turkey | 5 |
| 64 | Netherlands | 5 |
| 65 | Uruguay | 2 |
| 66 | Serbia | 5 |
| 67 | Madagascar | 4 |
| 68 | New Caledonia | 0 |
| 69 | Rwanda | 4 |
| 70 | Philippines | 3 |
| 71 | Curaçao | 1 |
| 72 | Macau | 3 |
| 73 | Maldives | 3 |
| 74 | Sápmi | 0 |
| 75 | Northern Cyprus | 0 |
| 76 | Mexico | 2 |
| 77 | Germany | 5 |
| 78 | Gabon | 4 |
| 79 | Armenia | 5 |
| 80 | Republic of Ireland | 5 |
| 81 | Montenegro | 5 |
| 82 | Poland | 5 |
| 83 | Togo | 4 |
| 84 | Malawi | 4 |
| 85 | India | 3 |
| 86 | French Guiana | 1 |
| 87 | Iraq | 3 |
| 88 | Kosovo | 5 |
| 89 | County of Nice | 0 |
| 90 | Republic of St. Pauli | 0 |
| 91 | Găgăuzia | 0 |
| 92 | Chile | 2 |
| 93 | Argentina | 2 |
| 94 | Brittany | 0 |
| 95 | Switzerland | 5 |
| 96 | Chad | 4 |
| 97 | Uganda | 4 |
| 98 | Scotland | 5 |
| 99 | Vietnam | 3 |
| 100 | Sierra Leone | 4 |
We can decode the previous label encoding.
confederation["confederation"].decode(
5, "UEFA",
4, "CAF",
3, "AFC",
2, "CONMEBOL",
1, "CONCACAF",
"OFC",
)
Abc home_teamVarchar(50) | Abc confederationVarchar(8) | |
|---|---|---|
| 1 | Lithuania | UEFA |
| 2 | Kuwait | AFC |
| 3 | Saint Martin | OFC |
| 4 | Brazil | CONMEBOL |
| 5 | Cameroon | CAF |
| 6 | Nigeria | CAF |
| 7 | Slovenia | UEFA |
| 8 | Iran | AFC |
| 9 | Canada | CONCACAF |
| 10 | Cayman Islands | OFC |
| 11 | Gotland | OFC |
| 12 | Gozo | OFC |
| 13 | Chinese Taipei | AFC |
| 14 | Kyrgyzstan | AFC |
| 15 | San Marino | UEFA |
| 16 | Colombia | CONMEBOL |
| 17 | Israel | UEFA |
| 18 | Basque Country | OFC |
| 19 | Benin | CAF |
| 20 | Seychelles | CAF |
Let’s export the result to our VAST DataBase.
vo.drop("confederation")
confederation["home_team"].rename("team")
confederation.to_db(
name = "confederation",
relation_type = "table",
)
Abc confederationVarchar(8) | Abc teamVarchar(50) | |
|---|---|---|
| 1 | CAF | Kenya |
| 2 | CAF | Burkina Faso |
| 3 | CAF | Mali |
| 4 | UEFA | Hungary |
| 5 | UEFA | Romania |
| 6 | UEFA | Finland |
| 7 | CONMEBOL | Bolivia |
| 8 | AFC | Australia |
| 9 | UEFA | France |
| 10 | OFC | Antigua and Barbuda |
| 11 | CAF | Central African Republic |
| 12 | AFC | Oman |
| 13 | UEFA | Andorra |
| 14 | AFC | Afghanistan |
| 15 | AFC | Bhutan |
| 16 | OFC | Anguilla |
| 17 | OFC | Panjab |
| 18 | OFC | Provence |
| 19 | OFC | Niue |
| 20 | OFC | Somaliland |
Team KPIs¶
We use just two variables to track teams: away_team and home_team. This makes it a bit difficult to compute new features. We need to duplicate the dataset and intervert the two teams. This way, we can compute KPIs using a partition by the first team to avoid double-counting any games.
football = vo.VastFrame("football_clean")
football.filter(fun.year(football["date"]) <= 2015)
football["home_team"].rename("team1")
football["home_score"].rename("team1_score")
football["away_team"].rename("team2")
football["away_score"].rename("team2_score")
football["neutral"].decode(True, 0, 1)
football2 = vo.VastFrame("football_clean")
football2.filter(fun.year(football["date"]) <= 2015)
football2["home_team"].rename("team2")
football2["home_score"].rename("team2_score")
football2["away_team"].rename("team1")
football2["away_score"].rename("team1_score")
football2["neutral"].decode(True, 0, 2)
# Merging the 2 interverted datasets
all_matchs = football.append(football2)
all_matchs["neutral"].rename("home_team_id")
📅 dateDate | Abc tournamentVarchar(50) | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 home_team_idInteger | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 1912-02-10 | Friendly | France | Paris | France | 7 | Catalonia | 0 | 1 |
| 2 | 1915-01-03 | Friendly | Spain | Bilbao | Basque Country | 6 | Catalonia | 1 | 1 |
| 3 | 1931-01-01 | Friendly | Spain | Bilbao | Basque Country | 3 | Catalonia | 2 | 1 |
| 4 | 1926-07-07 | Friendly | Czech Republic | Prague | Czech Republic | 2 | Catalonia | 1 | 1 |
| 5 | 1915-05-13 | Friendly | Spain | Madrid | Basque Country | 1 | Catalonia | 0 | 1 |
| 6 | 1971-02-21 | Friendly | Spain | Bilbao | Basque Country | 1 | Catalonia | 2 | 1 |
| 7 | 2007-12-29 | Friendly | Spain | Bilbao | Basque Country | 1 | Catalonia | 1 | 1 |
| 8 | 2014-12-28 | Friendly | Spain | Bilbao | Basque Country | 1 | Catalonia | 1 | 1 |
| 9 | 1916-06-04 | Friendly | Spain | Bilbao | Basque Country | 5 | Catalonia | 0 | 1 |
| 10 | 2005-02-16 | Friendly | Costa Rica | Heredia | Costa Rica | 1 | Ecuador | 2 | 1 |
| 11 | 2009-05-27 | Friendly | United States | Los Angeles | El Salvador | 3 | Ecuador | 1 | 0 |
| 12 | 1997-05-28 | Friendly | El Salvador | San Salvador | El Salvador | 0 | Ecuador | 2 | 1 |
| 13 | 1984-12-12 | Friendly | El Salvador | San Salvador | El Salvador | 0 | Ecuador | 0 | 1 |
| 14 | 1945-02-21 | Copa América | Chile | Santiago | Brazil | 9 | Ecuador | 2 | 0 |
| 15 | 2001-07-02 | Friendly | United States | East Rutherford | El Salvador | 0 | Ecuador | 1 | 0 |
| 16 | 1949-04-03 | Copa América | Brazil | Rio de Janeiro | Brazil | 9 | Ecuador | 1 | 1 |
| 17 | 1942-01-31 | Copa América | Uruguay | Montevideo | Brazil | 5 | Ecuador | 1 | 0 |
| 18 | 1996-02-11 | Friendly | Lebanon | Bourj Hammoud | Lebanon | 1 | Ecuador | 0 | 1 |
| 19 | 2011-06-01 | Friendly | Canada | Toronto | Canada | 2 | Ecuador | 2 | 1 |
| 20 | 1973-05-15 | Friendly | Haiti | Port-au-Prince | Haiti | 1 | Ecuador | 0 | 1 |
To compute the different aggregations, we need to add dummies which indicate the type of game and winner.
all_matchs["World_Tournament"] = fun.case_when(all_matchs["tournament"]._in(
[
"FIFA World Cup",
"Confederations Cup"
],
), 1, 0)
all_matchs["Continental_Tournament"] = fun.case_when(
all_matchs["tournament"]._in(
[
"UEFA Euro",
"Copa América",
"African Cup of Nations",
"AFC Asian Cup",
"Gold Cup",
"FIFA World Cup qualification",
]
), 1, 0)
all_matchs["Victory_team1"] = (all_matchs["team1_score"] > all_matchs["team2_score"])
all_matchs["Victory_team1"].astype("int")
all_matchs["Draw"] = (all_matchs["team1_score"] == all_matchs["team2_score"])
all_matchs["Draw"].astype("int")
📅 dateDate | Abc tournamentVarchar(50) | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 home_team_idInteger | 123 World_TournamentInteger | 123 Continental_TournamentInteger | 123 Victory_team1Int | 123 DrawInt | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1999-11-17 | UEFA Euro qualification | Ukraine | Kyïv | Ukraine | 1 | Slovenia | 1 | 1 | 0 | 0 | 0 | 1 |
| 2 | 2015-11-14 | UEFA Euro qualification | Ukraine | L'viv | Ukraine | 2 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 3 | 1994-10-12 | UEFA Euro qualification | Ukraine | Kyïv | Ukraine | 0 | Slovenia | 0 | 1 | 0 | 0 | 0 | 1 |
| 4 | 2005-10-08 | FIFA World Cup qualification | Italy | Palermo | Italy | 1 | Slovenia | 0 | 1 | 0 | 1 | 1 | 0 |
| 5 | 2002-08-21 | Friendly | Italy | Trieste | Italy | 0 | Slovenia | 1 | 1 | 0 | 0 | 0 | 0 |
| 6 | 1997-03-18 | Friendly | Austria | Linz | Austria | 0 | Slovenia | 2 | 1 | 0 | 0 | 0 | 0 |
| 7 | 2008-10-15 | FIFA World Cup qualification | Czech Republic | Teplice | Czech Republic | 1 | Slovenia | 0 | 1 | 0 | 1 | 1 | 0 |
| 8 | 1995-09-06 | UEFA Euro qualification | Italy | Udine | Italy | 1 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 9 | 2000-08-16 | Friendly | Czech Republic | Ostrava | Czech Republic | 0 | Slovenia | 1 | 1 | 0 | 0 | 0 | 0 |
| 10 | 2011-09-06 | UEFA Euro qualification | Italy | Florence | Italy | 1 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 11 | 1999-06-05 | UEFA Euro qualification | Latvia | Riga | Latvia | 1 | Slovenia | 2 | 1 | 0 | 0 | 0 | 0 |
| 12 | 2014-06-07 | Friendly | Argentina | La Plata | Argentina | 2 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 13 | 2008-09-06 | FIFA World Cup qualification | Poland | Wrocław | Poland | 1 | Slovenia | 1 | 1 | 0 | 1 | 0 | 1 |
| 14 | 2004-02-18 | Friendly | Spain | San Fernando | Poland | 2 | Slovenia | 0 | 0 | 0 | 0 | 1 | 0 |
| 15 | 1998-03-25 | Friendly | Poland | Warsaw | Poland | 2 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 16 | 2010-06-13 | FIFA World Cup | South Africa | Polokwane | Algeria | 0 | Slovenia | 1 | 0 | 1 | 0 | 0 | 0 |
| 17 | 2002-06-08 | FIFA World Cup | South Korea | Daegu | South Africa | 1 | Slovenia | 0 | 0 | 1 | 0 | 1 | 0 |
| 18 | 2014-03-05 | Friendly | Algeria | Blida | Algeria | 2 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 19 | 2014-09-08 | UEFA Euro qualification | Estonia | Tallinn | Estonia | 1 | Slovenia | 0 | 1 | 0 | 0 | 1 | 0 |
| 20 | 1995-06-11 | UEFA Euro qualification | Estonia | Tallinn | Estonia | 1 | Slovenia | 3 | 1 | 0 | 0 | 0 | 0 |
Now we can compute each team’s KPI.
teams_kpi = all_matchs.groupby(
["team1"],
[
fun.sum(all_matchs["World_Tournament"])._as("Number_Games_World_Tournament"),
fun.sum(all_matchs["Continental_Tournament"])._as("Number_Games_Continental_Tournament"),
fun.avg(fun.decode(all_matchs["World_Tournament"], 1, all_matchs["Victory_team1"]))._as("Percent_Victory_World_Tournament"),
fun.avg(fun.decode(all_matchs["Continental_Tournament"], 1, all_matchs["Victory_team1"]))._as("Percent_Victory_Continental_Tournament"),
fun.avg(fun.case_when((all_matchs["home_team_id"] == 1) & (all_matchs["World_Tournament"] == 0) & (all_matchs["Continental_Tournament"] == 0), all_matchs["Victory_team1"], None))._as("Percent_Victory_Home"),
fun.avg(fun.case_when((all_matchs["home_team_id"] != 1) & (all_matchs["World_Tournament"] == 0) & (all_matchs["Continental_Tournament"] == 0), all_matchs["Victory_team1"], None))._as("Percent_Victory_Away"),
fun.avg(all_matchs["Victory_team1"])._as("Percent_Victory"),
fun.avg(all_matchs["Draw"])._as("Percent_Draw"),
fun.avg(all_matchs["team1_score"])._as("Avg_goals"),
fun.avg(all_matchs["team2_score"])._as("Avg_goals_conceded"),
],
).sort({"Number_Games_World_Tournament": "desc"})
teams_kpi.head(100)
Abc team1Varchar(50) | 123 Number_Games_World_TournamentBigint | 123 Number_Games_Continental_TournamentBigint | 123 Percent_Victory_World_TournamentDouble | 123 Percent_Victory_Continental_TournamentDouble | 123 Percent_Victory_HomeDouble | 123 Percent_Victory_AwayDouble | 123 Percent_VictoryDouble | 123 Percent_DrawDouble | 123 Avg_goalsDouble | 123 Avg_goals_concededDouble | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Brazil | 137 | 279 | 0.6788321167883211 | 0.5770609318996416 | 0.7333333333333333 | 0.59375 | 0.635091496232508 | 0.20021528525296017 | 2.193756727664155 | 0.93756727664155 |
| 2 | Germany | 120 | 173 | 0.6 | 0.6242774566473989 | 0.6083916083916084 | 0.4702127659574468 | 0.5553691275167785 | 0.2080536912751678 | 2.0998322147651005 | 1.179530201342282 |
| 3 | Italy | 91 | 130 | 0.5274725274725275 | 0.6153846153846154 | 0.6438848920863309 | 0.3464566929133858 | 0.5245683930942895 | 0.28286852589641437 | 1.6958831341301461 | 0.9827357237715804 |
| 4 | Argentina | 87 | 302 | 0.5402298850574713 | 0.6059602649006622 | 0.638095238095238 | 0.40606060606060607 | 0.5360602798708288 | 0.24865446716899892 | 1.8654467168998923 | 1.0505920344456405 |
| 5 | Mexico | 75 | 258 | 0.30666666666666664 | 0.6085271317829457 | 0.5424836601307189 | 0.42356687898089174 | 0.495 | 0.2375 | 1.7475 | 1.07625 |
| 6 | Spain | 69 | 143 | 0.5217391304347826 | 0.6223776223776224 | 0.6768558951965066 | 0.46568627450980393 | 0.5813953488372093 | 0.2248062015503876 | 1.9674418604651163 | 0.9085271317829458 |
| 7 | France | 69 | 133 | 0.5362318840579711 | 0.5488721804511278 | 0.5321100917431193 | 0.36363636363636365 | 0.48081841432225064 | 0.21483375959079284 | 1.758312020460358 | 1.3427109974424551 |
| 8 | England | 62 | 129 | 0.41935483870967744 | 0.5968992248062015 | 0.6187845303867403 | 0.5308641975308642 | 0.5657620041753654 | 0.24112734864300625 | 2.19937369519833 | 0.9926931106471816 |
| 9 | Uruguay | 61 | 332 | 0.4098360655737705 | 0.5060240963855421 | 0.5 | 0.3007246376811594 | 0.4302741358760429 | 0.24553039332538737 | 1.5756853396901074 | 1.264600715137068 |
| 10 | Netherlands | 50 | 150 | 0.54 | 0.62 | 0.5422535211267606 | 0.3852140077821012 | 0.5033738191632928 | 0.22807017543859648 | 2.0620782726045883 | 1.2496626180836707 |
| 11 | United States | 48 | 215 | 0.2916666666666667 | 0.5674418604651162 | 0.40654205607476634 | 0.2620689655172414 | 0.41961414790996787 | 0.21221864951768488 | 1.4196141479099678 | 1.3713826366559485 |
| 12 | Sweden | 46 | 136 | 0.34782608695652173 | 0.5735294117647058 | 0.5805555555555556 | 0.41092636579572445 | 0.49428868120456904 | 0.21703011422637591 | 2.005192107995846 | 1.3063343717549325 |
| 13 | Serbia | 43 | 132 | 0.3953488372093023 | 0.5454545454545454 | 0.5445026178010471 | 0.3815028901734104 | 0.45646067415730335 | 0.21910112359550563 | 1.8160112359550562 | 1.3792134831460674 |
| 14 | Belgium | 41 | 135 | 0.34146341463414637 | 0.5333333333333333 | 0.4785714285714286 | 0.2846153846153846 | 0.4106145251396648 | 0.21927374301675978 | 1.6843575418994414 | 1.606145251396648 |
| 15 | Russia | 40 | 144 | 0.425 | 0.5902777777777778 | 0.5932203389830508 | 0.45614035087719296 | 0.521671826625387 | 0.2647058823529412 | 1.7198142414860682 | 0.93343653250774 |
| 16 | Czech Republic | 38 | 155 | 0.3684210526315789 | 0.5290322580645161 | 0.654320987654321 | 0.34185303514376997 | 0.4833110814419226 | 0.22162883845126835 | 1.843791722296395 | 1.2349799732977302 |
| 17 | South Korea | 34 | 192 | 0.20588235294117646 | 0.5625 | 0.5789473684210527 | 0.5122615803814714 | 0.5286783042394015 | 0.256857855361596 | 1.7830423940149627 | 0.8977556109725686 |
| 18 | Chile | 33 | 301 | 0.3333333333333333 | 0.3754152823920266 | 0.558282208588957 | 0.2571428571428571 | 0.38048090523338046 | 0.2065063649222065 | 1.4214992927864214 | 1.4653465346534653 |
| 19 | Japan | 33 | 152 | 0.2727272727272727 | 0.5526315789473685 | 0.5263157894736842 | 0.4009433962264151 | 0.47183098591549294 | 0.23415492957746478 | 1.7200704225352113 | 1.1602112676056338 |
| 20 | Switzerland | 33 | 129 | 0.3333333333333333 | 0.4186046511627907 | 0.41333333333333333 | 0.22758620689655173 | 0.3390957446808511 | 0.21675531914893617 | 1.4414893617021276 | 1.7313829787234043 |
| 21 | Hungary | 32 | 115 | 0.46875 | 0.46956521739130436 | 0.5809248554913294 | 0.3822784810126582 | 0.4740990990990991 | 0.2195945945945946 | 2.0720720720720722 | 1.4954954954954955 |
| 22 | Poland | 31 | 112 | 0.4838709677419355 | 0.4642857142857143 | 0.5 | 0.352112676056338 | 0.42597402597402595 | 0.2519480519480519 | 1.6844155844155844 | 1.37012987012987 |
| 23 | Cameroon | 31 | 154 | 0.25806451612903225 | 0.564935064935065 | 0.5882352941176471 | 0.32057416267942584 | 0.44258872651356995 | 0.30062630480167013 | 1.4217118997912317 | 1.0542797494780793 |
| 24 | Austria | 29 | 116 | 0.41379310344827586 | 0.47413793103448276 | 0.4837662337662338 | 0.30633802816901406 | 0.41112618724559025 | 0.2198100407055631 | 1.7978290366350067 | 1.5929443690637721 |
| 25 | Paraguay | 27 | 304 | 0.25925925925925924 | 0.40460526315789475 | 0.4423076923076923 | 0.29098360655737704 | 0.3637702503681885 | 0.2621502209131075 | 1.3357879234167893 | 1.438880706921944 |
| 26 | Portugal | 26 | 157 | 0.5 | 0.5222929936305732 | 0.5445026178010471 | 0.34615384615384615 | 0.4712230215827338 | 0.2302158273381295 | 1.631294964028777 | 1.2014388489208634 |
| 27 | Australia | 26 | 137 | 0.2692307692307692 | 0.583941605839416 | 0.4393939393939394 | 0.5112359550561798 | 0.4989429175475687 | 0.21141649048625794 | 2.031712473572939 | 1.1120507399577166 |
| 28 | Bulgaria | 26 | 124 | 0.11538461538461539 | 0.4596774193548387 | 0.4810810810810811 | 0.29276315789473684 | 0.37245696400625977 | 0.2519561815336463 | 1.431924882629108 | 1.4710485133020343 |
| 29 | Saudi Arabia | 25 | 149 | 0.2 | 0.5302013422818792 | 0.5604395604395604 | 0.41706161137440756 | 0.48324514991181655 | 0.2275132275132275 | 1.5961199294532629 | 1.0458553791887126 |
| 30 | Nigeria | 24 | 182 | 0.2916666666666667 | 0.5439560439560439 | 0.6203703703703703 | 0.319047619047619 | 0.4580152671755725 | 0.2958015267175573 | 1.4961832061068703 | 1.0038167938931297 |
| 31 | Colombia | 23 | 259 | 0.391304347826087 | 0.3667953667953668 | 0.46875 | 0.35714285714285715 | 0.378 | 0.272 | 1.206 | 1.21 |
| 32 | Scotland | 23 | 121 | 0.17391304347826086 | 0.48760330578512395 | 0.5847750865051903 | 0.3942307692307692 | 0.47651006711409394 | 0.2174496644295302 | 1.7503355704697987 | 1.225503355704698 |
| 33 | Romania | 21 | 130 | 0.38095238095238093 | 0.5 | 0.5922330097087378 | 0.31186440677966104 | 0.4401840490797546 | 0.2561349693251534 | 1.6457055214723926 | 1.2883435582822085 |
| 34 | Denmark | 19 | 137 | 0.5263157894736842 | 0.4233576642335766 | 0.5525423728813559 | 0.3466666666666667 | 0.44607190412782954 | 0.20372836218375498 | 1.77762982689747 | 1.4287616511318242 |
| 35 | South Africa | 17 | 85 | 0.17647058823529413 | 0.4823529411764706 | 0.5275590551181102 | 0.3709677419354839 | 0.4447592067988669 | 0.2747875354107649 | 1.339943342776204 | 1.0084985835694051 |
| 36 | Croatia | 16 | 64 | 0.4375 | 0.546875 | 0.6705882352941176 | 0.42574257425742573 | 0.5338345864661654 | 0.2706766917293233 | 1.7518796992481203 | 0.981203007518797 |
| 37 | New Zealand | 15 | 72 | 0.0 | 0.5416666666666666 | 0.4868421052631579 | 0.3468208092485549 | 0.40476190476190477 | 0.18154761904761904 | 1.7470238095238095 | 1.6130952380952381 |
| 38 | Costa Rica | 15 | 217 | 0.3333333333333333 | 0.43317972350230416 | 0.6238532110091743 | 0.3317307692307692 | 0.42987249544626593 | 0.2568306010928962 | 1.6703096539162112 | 1.1675774134790529 |
| 39 | Tunisia | 15 | 161 | 0.13333333333333333 | 0.4472049689440994 | 0.531578947368421 | 0.2777777777777778 | 0.4166666666666667 | 0.2916666666666667 | 1.433712121212121 | 1.0643939393939394 |
| 40 | Turkey | 15 | 130 | 0.4666666666666667 | 0.35384615384615387 | 0.4539877300613497 | 0.3380281690140845 | 0.381957773512476 | 0.2380038387715931 | 1.3320537428023032 | 1.4280230326295584 |
| 41 | Peru | 15 | 277 | 0.26666666666666666 | 0.3176895306859206 | 0.42857142857142855 | 0.2236024844720497 | 0.3129370629370629 | 0.243006993006993 | 1.229020979020979 | 1.4685314685314685 |
| 42 | Northern Ireland | 13 | 122 | 0.23076923076923078 | 0.30327868852459017 | 0.29017857142857145 | 0.1721311475409836 | 0.24378109452736318 | 0.23217247097844113 | 1.043117744610282 | 1.9535655058043118 |
| 43 | Republic of Ireland | 13 | 135 | 0.15384615384615385 | 0.37777777777777777 | 0.48756218905472637 | 0.3103448275862069 | 0.3919694072657744 | 0.27724665391969405 | 1.401529636711281 | 1.2466539196940727 |
| 44 | Algeria | 13 | 146 | 0.23076923076923078 | 0.410958904109589 | 0.5806451612903226 | 0.3163841807909605 | 0.4152173913043478 | 0.28043478260869564 | 1.3543478260869566 | 1.0304347826086957 |
| 45 | Greece | 13 | 132 | 0.15384615384615385 | 0.4090909090909091 | 0.45901639344262296 | 0.26262626262626265 | 0.3650190114068441 | 0.25285171102661597 | 1.2395437262357414 | 1.420152091254753 |
| 46 | Morocco | 13 | 161 | 0.15384615384615385 | 0.422360248447205 | 0.6122448979591837 | 0.3548387096774194 | 0.45168067226890757 | 0.3004201680672269 | 1.388655462184874 | 0.8739495798319328 |
| 47 | Ghana | 12 | 164 | 0.3333333333333333 | 0.5304878048780488 | 0.6727272727272727 | 0.38405797101449274 | 0.4822064056939502 | 0.25622775800711745 | 1.6423487544483986 | 1.0409252669039146 |
| 48 | Iran | 12 | 175 | 0.08333333333333333 | 0.5942857142857143 | 0.6415094339622641 | 0.43037974683544306 | 0.5343680709534369 | 0.2616407982261641 | 1.8403547671840355 | 0.835920177383592 |
| 49 | Ivory Coast | 11 | 160 | 0.2727272727272727 | 0.49375 | 0.6917293233082706 | 0.4 | 0.5029469548133595 | 0.24950884086444008 | 1.6345776031434185 | 1.0530451866404715 |
| 50 | Ecuador | 10 | 244 | 0.4 | 0.2459016393442623 | 0.59375 | 0.24025974025974026 | 0.2944915254237288 | 0.2457627118644068 | 1.194915254237288 | 1.6504237288135593 |
| 51 | Egypt | 10 | 174 | 0.1 | 0.5632183908045977 | 0.5823529411764706 | 0.3739130434782609 | 0.4863013698630137 | 0.25 | 1.643835616438356 | 1.0359589041095891 |
| 52 | Honduras | 9 | 175 | 0.0 | 0.44 | 0.5483870967741935 | 0.3316062176165803 | 0.4085106382978723 | 0.26170212765957446 | 1.4914893617021276 | 1.2234042553191489 |
| 53 | Bolivia | 9 | 243 | 0.0 | 0.2222222222222222 | 0.3787878787878788 | 0.13861386138613863 | 0.22195704057279236 | 0.24821002386634844 | 1.0381861575178997 | 1.9427207637231503 |
| 54 | Norway | 8 | 118 | 0.25 | 0.3474576271186441 | 0.3948220064724919 | 0.3343465045592705 | 0.3599476439790576 | 0.22774869109947643 | 1.5013089005235603 | 1.6845549738219896 |
| 55 | North Korea | 7 | 97 | 0.14285714285714285 | 0.4329896907216495 | 0.7333333333333333 | 0.4088397790055249 | 0.4266666666666667 | 0.27 | 1.61 | 1.0366666666666666 |
| 56 | Iraq | 6 | 124 | 0.0 | 0.4596774193548387 | 0.6666666666666666 | 0.436241610738255 | 0.4676113360323887 | 0.2773279352226721 | 1.6214574898785425 | 0.9453441295546559 |
| 57 | El Salvador | 6 | 156 | 0.0 | 0.4166666666666667 | 0.4819277108433735 | 0.2009132420091324 | 0.32112068965517243 | 0.22629310344827586 | 1.2262931034482758 | 1.4870689655172413 |
| 58 | United Arab Emirates | 6 | 123 | 0.16666666666666666 | 0.3983739837398374 | 0.4768211920529801 | 0.3368421052631579 | 0.39574468085106385 | 0.24893617021276596 | 1.4148936170212767 | 1.2851063829787235 |
| 59 | Slovenia | 6 | 55 | 0.16666666666666666 | 0.38181818181818183 | 0.4264705882352941 | 0.2857142857142857 | 0.352112676056338 | 0.2347417840375587 | 1.2394366197183098 | 1.272300469483568 |
| 60 | Canada | 6 | 144 | 0.0 | 0.3888888888888889 | 0.3387096774193548 | 0.2814814814814815 | 0.3314121037463977 | 0.23919308357348704 | 1.0489913544668588 | 1.3976945244956773 |
| 61 | Ukraine | 5 | 63 | 0.4 | 0.49206349206349204 | 0.5285714285714286 | 0.33707865168539325 | 0.44052863436123346 | 0.2907488986784141 | 1.39647577092511 | 0.973568281938326 |
| 62 | Wales | 5 | 110 | 0.2 | 0.3 | 0.3670886075949367 | 0.26515151515151514 | 0.31006493506493504 | 0.21266233766233766 | 1.2532467532467533 | 1.6931818181818181 |
| 63 | Senegal | 5 | 106 | 0.4 | 0.3584905660377358 | 0.648 | 0.3360655737704918 | 0.42291666666666666 | 0.26875 | 1.2875 | 1.0020833333333334 |
| 64 | Slovakia | 4 | 54 | 0.25 | 0.48148148148148145 | 0.45 | 0.3333333333333333 | 0.40160642570281124 | 0.23694779116465864 | 1.4417670682730923 | 1.3012048192771084 |
| 65 | DR Congo | 3 | 135 | 0.0 | 0.362962962962963 | 0.6153846153846154 | 0.3081081081081081 | 0.391304347826087 | 0.26811594202898553 | 1.502415458937198 | 1.2536231884057971 |
| 66 | Jamaica | 3 | 128 | 0.3333333333333333 | 0.34375 | 0.5304878048780488 | 0.30973451327433627 | 0.3877159309021113 | 0.22840690978886757 | 1.3186180422264875 | 1.3378119001919386 |
| 67 | China PR | 3 | 147 | 0.0 | 0.5510204081632653 | 0.5796178343949044 | 0.3958333333333333 | 0.48811700182815354 | 0.226691042047532 | 1.8372943327239488 | 1.0877513711151736 |
| 68 | Cuba | 3 | 92 | 0.3333333333333333 | 0.25 | 0.45 | 0.3728813559322034 | 0.34615384615384615 | 0.25 | 1.3205128205128205 | 1.439102564102564 |
| 69 | Bosnia and Herzegovina | 3 | 48 | 0.3333333333333333 | 0.4791666666666667 | 0.42857142857142855 | 0.3048780487804878 | 0.38461538461538464 | 0.21428571428571427 | 1.4285714285714286 | 1.39010989010989 |
| 70 | Tahiti | 3 | 27 | 0.0 | 0.2962962962962963 | 0.4838709677419355 | 0.5846153846153846 | 0.518324607329843 | 0.1256544502617801 | 2.518324607329843 | 1.7015706806282722 |
| 71 | Trinidad and Tobago | 3 | 145 | 0.0 | 0.3793103448275862 | 0.6224489795918368 | 0.3763440860215054 | 0.45264847512038525 | 0.2102728731942215 | 1.739967897271268 | 1.274478330658106 |
| 72 | Togo | 3 | 85 | 0.0 | 0.2823529411764706 | 0.4845360824742268 | 0.23636363636363636 | 0.3142857142857143 | 0.24571428571428572 | 1.082857142857143 | 1.3914285714285715 |
| 73 | Kuwait | 3 | 133 | 0.0 | 0.47368421052631576 | 0.4573170731707317 | 0.37916666666666665 | 0.42407407407407405 | 0.2722222222222222 | 1.5555555555555556 | 1.0796296296296297 |
| 74 | Angola | 3 | 84 | 0.0 | 0.3333333333333333 | 0.5625 | 0.2535211267605634 | 0.35275080906148865 | 0.35275080906148865 | 1.174757281553398 | 1.0420711974110033 |
| 75 | Israel | 3 | 124 | 0.0 | 0.3548387096774194 | 0.38926174496644295 | 0.30327868852459017 | 0.3492462311557789 | 0.25125628140703515 | 1.4547738693467336 | 1.4522613065326633 |
| 76 | Haiti | 3 | 102 | 0.0 | 0.4019607843137255 | 0.5304347826086957 | 0.35858585858585856 | 0.4138755980861244 | 0.23205741626794257 | 1.562200956937799 | 1.3181818181818181 |
| 77 | Indonesia | 1 | 82 | 0.0 | 0.25609756097560976 | 0.49264705882352944 | 0.35906040268456374 | 0.3771760154738878 | 0.18762088974854932 | 1.6731141199226305 | 1.6750483558994198 |
| 78 | Lithuania | 0 | 63 | [null] | 0.25396825396825395 | 0.4090909090909091 | 0.24293785310734464 | 0.2896341463414634 | 0.18902439024390244 | 1.0975609756097562 | 1.7835365853658536 |
| 79 | Palestine | 0 | 25 | [null] | 0.28 | 0.0 | 0.25 | 0.25165562913907286 | 0.26490066225165565 | 1.2847682119205297 | 1.6026490066225165 |
| 80 | Estonia | 0 | 66 | [null] | 0.19696969696969696 | 0.3618421052631579 | 0.18686868686868688 | 0.25240384615384615 | 0.21394230769230768 | 1.0240384615384615 | 1.78125 |
| 81 | Saint Martin | 0 | 0 | [null] | [null] | 0.75 | 0.16 | 0.30303030303030304 | 0.09090909090909091 | 1.121212121212121 | 2.909090909090909 |
| 82 | North Macedonia | 0 | 49 | [null] | 0.20408163265306123 | 0.39705882352941174 | 0.2 | 0.26732673267326734 | 0.2623762376237624 | 1.0841584158415842 | 1.381188118811881 |
| 83 | Cayman Islands | 0 | 14 | [null] | 0.0 | 0.3333333333333333 | 0.13513513513513514 | 0.18518518518518517 | 0.16049382716049382 | 1.037037037037037 | 2.54320987654321 |
| 84 | Catalonia | 0 | 0 | [null] | [null] | 0.4594594594594595 | 0.1111111111111111 | 0.391304347826087 | 0.2391304347826087 | 1.5217391304347827 | 1.7391304347826086 |
| 85 | Mayotte | 0 | 0 | [null] | [null] | 0.0 | 0.1875 | 0.16666666666666666 | 0.2777777777777778 | 1.6111111111111112 | 2.0555555555555554 |
| 86 | Curaçao | 0 | 60 | [null] | 0.21666666666666667 | 0.6666666666666666 | 0.29444444444444445 | 0.3564356435643564 | 0.26732673267326734 | 1.5478547854785478 | 1.6765676567656767 |
| 87 | Gambia | 0 | 24 | [null] | 0.25 | 0.34328358208955223 | 0.16 | 0.2356020942408377 | 0.2879581151832461 | 0.93717277486911 | 1.450261780104712 |
| 88 | New Caledonia | 0 | 16 | [null] | 0.5 | 0.625 | 0.4918032786885246 | 0.5346534653465347 | 0.09900990099009901 | 2.633663366336634 | 1.4752475247524752 |
| 89 | Rwanda | 0 | 40 | [null] | 0.2 | 0.44642857142857145 | 0.3247863247863248 | 0.3333333333333333 | 0.2535211267605634 | 1.051643192488263 | 1.2253521126760563 |
| 90 | Saint Kitts and Nevis | 0 | 26 | [null] | 0.34615384615384615 | 0.5076923076923077 | 0.3064516129032258 | 0.39869281045751637 | 0.1895424836601307 | 1.7973856209150327 | 1.5947712418300655 |
| 91 | Philippines | 0 | 19 | [null] | 0.15789473684210525 | 0.47619047619047616 | 0.22727272727272727 | 0.27461139896373055 | 0.14507772020725387 | 1.16580310880829 | 2.2797927461139897 |
| 92 | Macau | 0 | 34 | [null] | 0.08823529411764706 | 0.21739130434782608 | 0.14285714285714285 | 0.14150943396226415 | 0.09433962264150944 | 0.7641509433962265 | 3.2641509433962264 |
| 93 | Yemen | 0 | 53 | [null] | 0.22641509433962265 | 0.42857142857142855 | 0.13432835820895522 | 0.20270270270270271 | 0.17567567567567569 | 1.0045045045045045 | 2.3468468468468466 |
| 94 | Guyana | 0 | 32 | [null] | 0.21875 | 0.3870967741935484 | 0.2564102564102564 | 0.30165289256198347 | 0.2066115702479339 | 1.1983471074380165 | 1.7479338842975207 |
| 95 | Madagascar | 0 | 37 | [null] | 0.32432432432432434 | 0.4642857142857143 | 0.3218390804597701 | 0.36666666666666664 | 0.19444444444444445 | 1.3333333333333333 | 1.6333333333333333 |
| 96 | Burundi | 0 | 20 | [null] | 0.35 | 0.37037037037037035 | 0.2972972972972973 | 0.31645569620253167 | 0.24050632911392406 | 1.0379746835443038 | 1.2974683544303798 |
| 97 | Sápmi | 0 | 0 | [null] | [null] | 0.375 | 0.5 | 0.42857142857142855 | 0.14285714285714285 | 4.357142857142857 | 1.7142857142857142 |
| 98 | Maldives | 0 | 30 | [null] | 0.2 | 0.36666666666666664 | 0.2777777777777778 | 0.2803030303030303 | 0.18181818181818182 | 1.3409090909090908 | 2.234848484848485 |
| 99 | Sudan | 0 | 87 | [null] | 0.25287356321839083 | 0.5921052631578947 | 0.2783018867924528 | 0.336 | 0.248 | 1.1413333333333333 | 1.368 |
| 100 | Northern Cyprus | 0 | 0 | [null] | [null] | 0.8 | 0.4 | 0.5333333333333333 | 0.06666666666666667 | 2.2666666666666666 | 1.2 |
We can join the different information about the cup winners to enrich our dataset. We’ll be using this later, so let’s export it to our VAST DataBase.
vo.drop("teams_kpi", method = "table")
teams_kpi = teams_kpi.join(
football_cup_winners,
on = {"team1": "winner"},
how = "left",
expr2 = [
"nb_World_Cup",
"nb_Continental_Cup",
],
).to_db("teams_kpi", relation_type = "table")
teams_kpi.head(100)
Abc team1Varchar(50) | 123 Number_Games_World_TournamentBigint | 123 Number_Games_Continental_TournamentBigint | 123 Percent_Victory_World_TournamentDouble | 123 Percent_Victory_Continental_TournamentDouble | 123 Percent_Victory_HomeDouble | 123 Percent_Victory_AwayDouble | 123 Percent_VictoryDouble | 123 Percent_DrawDouble | 123 Avg_goalsDouble | 123 Avg_goals_concededDouble | 123 nb_World_CupBigint | 123 nb_Continental_CupBigint | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Honduras | 9 | 175 | 0.0 | 0.44 | 0.5483870967741935 | 0.3316062176165803 | 0.4085106382978723 | 0.26170212765957446 | 1.4914893617021276 | 1.2234042553191489 | [null] | [null] |
| 2 | South Korea | 34 | 192 | 0.20588235294117646 | 0.5625 | 0.5789473684210527 | 0.5122615803814714 | 0.5286783042394015 | 0.256857855361596 | 1.7830423940149627 | 0.8977556109725686 | 0 | 3 |
| 3 | New Zealand | 15 | 72 | 0.0 | 0.5416666666666666 | 0.4868421052631579 | 0.3468208092485549 | 0.40476190476190477 | 0.18154761904761904 | 1.7470238095238095 | 1.6130952380952381 | [null] | [null] |
| 4 | Nepal | 0 | 30 | [null] | 0.13333333333333333 | 0.39473684210526316 | 0.14634146341463414 | 0.20666666666666667 | 0.14 | 0.8133333333333334 | 2.5866666666666664 | [null] | [null] |
| 5 | Ecuador | 10 | 244 | 0.4 | 0.2459016393442623 | 0.59375 | 0.24025974025974026 | 0.2944915254237288 | 0.2457627118644068 | 1.194915254237288 | 1.6504237288135593 | 0 | 1 |
| 6 | Eritrea | 0 | 8 | [null] | 0.0 | 0.4166666666666667 | 0.12 | 0.15714285714285714 | 0.22857142857142856 | 0.6714285714285714 | 1.7428571428571429 | [null] | [null] |
| 7 | Isle of Man | 0 | 0 | [null] | [null] | 0.25 | 0.5555555555555556 | 0.525 | 0.1 | 2.8 | 1.625 | [null] | [null] |
| 8 | Niger | 0 | 36 | [null] | 0.25 | 0.4482758620689655 | 0.0898876404494382 | 0.23497267759562843 | 0.2568306010928962 | 0.9344262295081968 | 1.644808743169399 | [null] | [null] |
| 9 | Gambia | 0 | 24 | [null] | 0.25 | 0.34328358208955223 | 0.16 | 0.2356020942408377 | 0.2879581151832461 | 0.93717277486911 | 1.450261780104712 | [null] | [null] |
| 10 | Sudan | 0 | 87 | [null] | 0.25287356321839083 | 0.5921052631578947 | 0.2783018867924528 | 0.336 | 0.248 | 1.1413333333333333 | 1.368 | [null] | [null] |
| 11 | Catalonia | 0 | 0 | [null] | [null] | 0.4594594594594595 | 0.1111111111111111 | 0.391304347826087 | 0.2391304347826087 | 1.5217391304347827 | 1.7391304347826086 | [null] | [null] |
| 12 | Iceland | 0 | 96 | [null] | 0.21875 | 0.4307692307692308 | 0.23780487804878048 | 0.29743589743589743 | 0.18974358974358974 | 1.1641025641025642 | 1.7 | [null] | [null] |
| 13 | Saint Lucia | 0 | 22 | [null] | 0.2727272727272727 | 0.40350877192982454 | 0.308411214953271 | 0.3333333333333333 | 0.13978494623655913 | 1.4731182795698925 | 1.9623655913978495 | [null] | [null] |
| 14 | Saint Pierre and Miquelon | 0 | 0 | [null] | [null] | [null] | 0.0 | 0.0 | 0.0 | 0.16666666666666666 | 10.333333333333334 | [null] | [null] |
| 15 | Felvidék | 0 | 0 | [null] | [null] | [null] | 0.3333333333333333 | 0.3333333333333333 | 0.3333333333333333 | 1.3333333333333333 | 2.3333333333333335 | [null] | [null] |
| 16 | Brazil | 137 | 279 | 0.6788321167883211 | 0.5770609318996416 | 0.7333333333333333 | 0.59375 | 0.635091496232508 | 0.20021528525296017 | 2.193756727664155 | 0.93756727664155 | 4 | 8 |
| 17 | Canada | 6 | 144 | 0.0 | 0.3888888888888889 | 0.3387096774193548 | 0.2814814814814815 | 0.3314121037463977 | 0.23919308357348704 | 1.0489913544668588 | 1.3976945244956773 | 0 | 2 |
| 18 | Iran | 12 | 175 | 0.08333333333333333 | 0.5942857142857143 | 0.6415094339622641 | 0.43037974683544306 | 0.5343680709534369 | 0.2616407982261641 | 1.8403547671840355 | 0.835920177383592 | 0 | 1 |
| 19 | Kuwait | 3 | 133 | 0.0 | 0.47368421052631576 | 0.4573170731707317 | 0.37916666666666665 | 0.42407407407407405 | 0.2722222222222222 | 1.5555555555555556 | 1.0796296296296297 | 0 | 1 |
| 20 | Slovenia | 6 | 55 | 0.16666666666666666 | 0.38181818181818183 | 0.4264705882352941 | 0.2857142857142857 | 0.352112676056338 | 0.2347417840375587 | 1.2394366197183098 | 1.272300469483568 | [null] | [null] |
| 21 | Nigeria | 24 | 182 | 0.2916666666666667 | 0.5439560439560439 | 0.6203703703703703 | 0.319047619047619 | 0.4580152671755725 | 0.2958015267175573 | 1.4961832061068703 | 1.0038167938931297 | 0 | 3 |
| 22 | Cameroon | 31 | 154 | 0.25806451612903225 | 0.564935064935065 | 0.5882352941176471 | 0.32057416267942584 | 0.44258872651356995 | 0.30062630480167013 | 1.4217118997912317 | 1.0542797494780793 | 0 | 2 |
| 23 | Lithuania | 0 | 63 | [null] | 0.25396825396825395 | 0.4090909090909091 | 0.24293785310734464 | 0.2896341463414634 | 0.18902439024390244 | 1.0975609756097562 | 1.7835365853658536 | [null] | [null] |
| 24 | Cayman Islands | 0 | 14 | [null] | 0.0 | 0.3333333333333333 | 0.13513513513513514 | 0.18518518518518517 | 0.16049382716049382 | 1.037037037037037 | 2.54320987654321 | [null] | [null] |
| 25 | Gotland | 0 | 0 | [null] | [null] | 0.6 | 0.2857142857142857 | 0.34615384615384615 | 0.15384615384615385 | 2.4615384615384617 | 2.0 | [null] | [null] |
| 26 | Saint Martin | 0 | 0 | [null] | [null] | 0.75 | 0.16 | 0.30303030303030304 | 0.09090909090909091 | 1.121212121212121 | 2.909090909090909 | [null] | [null] |
| 27 | Japan | 33 | 152 | 0.2727272727272727 | 0.5526315789473685 | 0.5263157894736842 | 0.4009433962264151 | 0.47183098591549294 | 0.23415492957746478 | 1.7200704225352113 | 1.1602112676056338 | 0 | 2 |
| 28 | Thailand | 0 | 97 | [null] | 0.24742268041237114 | 0.5642201834862385 | 0.259927797833935 | 0.36993243243243246 | 0.22972972972972974 | 1.5456081081081081 | 1.5945945945945945 | [null] | [null] |
| 29 | United Arab Emirates | 6 | 123 | 0.16666666666666666 | 0.3983739837398374 | 0.4768211920529801 | 0.3368421052631579 | 0.39574468085106385 | 0.24893617021276596 | 1.4148936170212767 | 1.2851063829787235 | [null] | [null] |
| 30 | Senegal | 5 | 106 | 0.4 | 0.3584905660377358 | 0.648 | 0.3360655737704918 | 0.42291666666666666 | 0.26875 | 1.2875 | 1.0020833333333334 | [null] | [null] |
| 31 | Liberia | 0 | 64 | [null] | 0.25 | 0.4567901234567901 | 0.1 | 0.27111111111111114 | 0.23555555555555555 | 0.8888888888888888 | 1.4088888888888889 | [null] | [null] |
| 32 | Guatemala | 0 | 139 | [null] | 0.33093525179856115 | 0.46808510638297873 | 0.2857142857142857 | 0.3412322274881517 | 0.25829383886255924 | 1.3293838862559242 | 1.3696682464454977 | [null] | [null] |
| 33 | Syria | 0 | 85 | [null] | 0.4470588235294118 | 0.43137254901960786 | 0.33181818181818185 | 0.37359550561797755 | 0.23314606741573032 | 1.4803370786516854 | 1.3314606741573034 | [null] | [null] |
| 34 | Hong Kong | 0 | 82 | [null] | 0.2804878048780488 | 0.43333333333333335 | 0.3005464480874317 | 0.3295774647887324 | 0.21971830985915494 | 1.5295774647887324 | 1.684507042253521 | [null] | [null] |
| 35 | South Sudan | 0 | 2 | [null] | 0.0 | 0.5 | 0.14285714285714285 | 0.16666666666666666 | 0.2777777777777778 | 0.5555555555555556 | 1.5555555555555556 | [null] | [null] |
| 36 | Bosnia and Herzegovina | 3 | 48 | 0.3333333333333333 | 0.4791666666666667 | 0.42857142857142855 | 0.3048780487804878 | 0.38461538461538464 | 0.21428571428571427 | 1.4285714285714286 | 1.39010989010989 | [null] | [null] |
| 37 | Albania | 0 | 94 | [null] | 0.14893617021276595 | 0.40425531914893614 | 0.17307692307692307 | 0.23972602739726026 | 0.2226027397260274 | 0.9006849315068494 | 1.595890410958904 | [null] | [null] |
| 38 | Luxembourg | 0 | 124 | [null] | 0.03225806451612903 | 0.11029411764705882 | 0.058823529411764705 | 0.06906077348066299 | 0.11878453038674033 | 0.5662983425414365 | 2.8121546961325965 | [null] | [null] |
| 39 | Moldova | 0 | 48 | [null] | 0.10416666666666667 | 0.26666666666666666 | 0.23 | 0.20725388601036268 | 0.23834196891191708 | 0.8808290155440415 | 1.6269430051813472 | [null] | [null] |
| 40 | Namibia | 0 | 49 | [null] | 0.1836734693877551 | 0.35185185185185186 | 0.19540229885057472 | 0.23684210526315788 | 0.28421052631578947 | 1.0157894736842106 | 1.5315789473684212 | [null] | [null] |
| 41 | Iraqi Kurdistan | 0 | 0 | [null] | [null] | 1.0 | 0.35294117647058826 | 0.45 | 0.25 | 2.1 | 1.15 | [null] | [null] |
| 42 | Tamil Eelam | 0 | 0 | [null] | [null] | [null] | 0.16666666666666666 | 0.16666666666666666 | 0.0 | 1.0 | 4.166666666666667 | [null] | [null] |
| 43 | Comoros | 0 | 8 | [null] | 0.0 | 0.0 | 0.14285714285714285 | 0.07142857142857142 | 0.2857142857142857 | 0.5 | 1.7142857142857142 | [null] | [null] |
| 44 | Samoa | 0 | 10 | [null] | 0.3 | 0.47058823529411764 | 0.23529411764705882 | 0.3409090909090909 | 0.09090909090909091 | 1.5454545454545454 | 2.9545454545454546 | [null] | [null] |
| 45 | Shetland | 0 | 0 | [null] | [null] | 0.6 | 0.34210526315789475 | 0.37209302325581395 | 0.16279069767441862 | 1.627906976744186 | 1.8604651162790697 | [null] | [null] |
| 46 | Falkland Islands | 0 | 0 | [null] | [null] | [null] | 0.24 | 0.24 | 0.0 | 1.0 | 3.8 | [null] | [null] |
| 47 | Montserrat | 0 | 9 | [null] | 0.0 | 1.0 | 0.10526315789473684 | 0.13333333333333333 | 0.06666666666666667 | 1.0333333333333334 | 4.4 | [null] | [null] |
| 48 | Corsica | 0 | 0 | [null] | [null] | 0.4 | [null] | 0.4 | 0.4 | 0.8 | 0.6 | [null] | [null] |
| 49 | Costa Rica | 15 | 217 | 0.3333333333333333 | 0.43317972350230416 | 0.6238532110091743 | 0.3317307692307692 | 0.42987249544626593 | 0.2568306010928962 | 1.6703096539162112 | 1.1675774134790529 | [null] | [null] |
| 50 | Indonesia | 1 | 82 | 0.0 | 0.25609756097560976 | 0.49264705882352944 | 0.35906040268456374 | 0.3771760154738878 | 0.18762088974854932 | 1.6731141199226305 | 1.6750483558994198 | [null] | [null] |
| 51 | Italy | 91 | 130 | 0.5274725274725275 | 0.6153846153846154 | 0.6438848920863309 | 0.3464566929133858 | 0.5245683930942895 | 0.28286852589641437 | 1.6958831341301461 | 0.9827357237715804 | 3 | 1 |
| 52 | Morocco | 13 | 161 | 0.15384615384615385 | 0.422360248447205 | 0.6122448979591837 | 0.3548387096774194 | 0.45168067226890757 | 0.3004201680672269 | 1.388655462184874 | 0.8739495798319328 | [null] | [null] |
| 53 | Somalia | 0 | 11 | [null] | 0.0 | 0.3333333333333333 | 0.08333333333333333 | 0.0891089108910891 | 0.1188118811881188 | 0.504950495049505 | 2.801980198019802 | [null] | [null] |
| 54 | Algeria | 13 | 146 | 0.23076923076923078 | 0.410958904109589 | 0.5806451612903226 | 0.3163841807909605 | 0.4152173913043478 | 0.28043478260869564 | 1.3543478260869566 | 1.0304347826086957 | 0 | 1 |
| 55 | Belize | 0 | 22 | [null] | 0.22727272727272727 | 0.5 | 0.037037037037037035 | 0.1864406779661017 | 0.1694915254237288 | 1.0338983050847457 | 2.23728813559322 | [null] | [null] |
| 56 | Djibouti | 0 | 12 | [null] | 0.08333333333333333 | 0.07692307692307693 | 0.0 | 0.0273972602739726 | 0.0547945205479452 | 0.684931506849315 | 4.027397260273973 | [null] | [null] |
| 57 | Nicaragua | 0 | 19 | [null] | 0.21052631578947367 | 0.6 | 0.0989010989010989 | 0.15833333333333333 | 0.06666666666666667 | 0.825 | 3.191666666666667 | [null] | [null] |
| 58 | Cook Islands | 0 | 10 | [null] | 0.0 | 0.5 | 0.2413793103448276 | 0.20930232558139536 | 0.09302325581395349 | 0.8837209302325582 | 5.372093023255814 | [null] | [null] |
| 59 | Jersey | 0 | 0 | [null] | [null] | 0.8 | 0.6346153846153846 | 0.6805555555555556 | 0.1388888888888889 | 2.125 | 0.9166666666666666 | [null] | [null] |
| 60 | Hitra | 0 | 0 | [null] | [null] | [null] | 0.16666666666666666 | 0.16666666666666666 | 0.0 | 1.1666666666666667 | 4.833333333333333 | [null] | [null] |
| 61 | Saarland | 0 | 2 | [null] | 0.0 | 0.0 | [null] | 0.0 | 0.3333333333333333 | 0.8333333333333334 | 3.0 | [null] | [null] |
| 62 | Artsakh | 0 | 0 | [null] | [null] | 1.0 | [null] | 1.0 | 0.0 | 3.0 | 0.0 | [null] | [null] |
| 63 | Oman | 0 | 76 | [null] | 0.3815789473684211 | 0.46258503401360546 | 0.2596685082872928 | 0.3564356435643564 | 0.24752475247524752 | 1.2648514851485149 | 1.2896039603960396 | [null] | [null] |
| 64 | Australia | 26 | 137 | 0.2692307692307692 | 0.583941605839416 | 0.4393939393939394 | 0.5112359550561798 | 0.4989429175475687 | 0.21141649048625794 | 2.031712473572939 | 1.1120507399577166 | 0 | 1 |
| 65 | France | 69 | 133 | 0.5362318840579711 | 0.5488721804511278 | 0.5321100917431193 | 0.36363636363636365 | 0.48081841432225064 | 0.21483375959079284 | 1.758312020460358 | 1.3427109974424551 | 1 | 2 |
| 66 | Hungary | 32 | 115 | 0.46875 | 0.46956521739130436 | 0.5809248554913294 | 0.3822784810126582 | 0.4740990990990991 | 0.2195945945945946 | 2.0720720720720722 | 1.4954954954954955 | [null] | [null] |
| 67 | Burkina Faso | 0 | 90 | [null] | 0.3111111111111111 | 0.5053763440860215 | 0.19753086419753085 | 0.3101449275362319 | 0.263768115942029 | 1.1594202898550725 | 1.4202898550724639 | [null] | [null] |
| 68 | Mali | 0 | 75 | [null] | 0.37333333333333335 | 0.568 | 0.32558139534883723 | 0.39956331877729256 | 0.24672489082969432 | 1.2729257641921397 | 1.1768558951965065 | [null] | [null] |
| 69 | Antigua and Barbuda | 0 | 36 | [null] | 0.2777777777777778 | 0.47058823529411764 | 0.23333333333333334 | 0.3107344632768362 | 0.20903954802259886 | 1.3954802259887005 | 1.7005649717514124 | [null] | [null] |
| 70 | Finland | 0 | 119 | [null] | 0.25210084033613445 | 0.30735930735930733 | 0.20285714285714285 | 0.24571428571428572 | 0.21 | 1.18 | 2.162857142857143 | [null] | [null] |
| 71 | Kenya | 0 | 80 | [null] | 0.3 | 0.521505376344086 | 0.32335329341317365 | 0.38166666666666665 | 0.23666666666666666 | 1.4316666666666666 | 1.3966666666666667 | [null] | [null] |
| 72 | Andorra | 0 | 42 | [null] | 0.023809523809523808 | 0.05714285714285714 | 0.0 | 0.022900763358778626 | 0.07633587786259542 | 0.2824427480916031 | 2.8244274809160306 | [null] | [null] |
| 73 | Romania | 21 | 130 | 0.38095238095238093 | 0.5 | 0.5922330097087378 | 0.31186440677966104 | 0.4401840490797546 | 0.2561349693251534 | 1.6457055214723926 | 1.2883435582822085 | [null] | [null] |
| 74 | Central African Republic | 0 | 10 | [null] | 0.1 | 0.35294117647058826 | 0.12 | 0.16883116883116883 | 0.2077922077922078 | 1.025974025974026 | 2.064935064935065 | [null] | [null] |
| 75 | Anguilla | 0 | 9 | [null] | 0.0 | 0.0 | 0.09375 | 0.0625 | 0.0625 | 0.6666666666666666 | 4.041666666666667 | [null] | [null] |
| 76 | Bolivia | 9 | 243 | 0.0 | 0.2222222222222222 | 0.3787878787878788 | 0.13861386138613863 | 0.22195704057279236 | 0.24821002386634844 | 1.0381861575178997 | 1.9427207637231503 | 0 | 1 |
| 77 | Bhutan | 0 | 9 | [null] | 0.2222222222222222 | 0.6666666666666666 | 0.0392156862745098 | 0.09523809523809523 | 0.06349206349206349 | 0.6190476190476191 | 3.9523809523809526 | [null] | [null] |
| 78 | Afghanistan | 0 | 12 | [null] | 0.16666666666666666 | 0.4 | 0.29577464788732394 | 0.2840909090909091 | 0.20454545454545456 | 1.0795454545454546 | 2.0568181818181817 | [null] | [null] |
| 79 | Provence | 0 | 0 | [null] | [null] | [null] | 0.16666666666666666 | 0.16666666666666666 | 0.08333333333333333 | 1.3333333333333333 | 3.5 | [null] | [null] |
| 80 | Colombia | 23 | 259 | 0.391304347826087 | 0.3667953667953668 | 0.46875 | 0.35714285714285715 | 0.378 | 0.272 | 1.206 | 1.21 | 0 | 1 |
| 81 | Israel | 3 | 124 | 0.0 | 0.3548387096774194 | 0.38926174496644295 | 0.30327868852459017 | 0.3492462311557789 | 0.25125628140703515 | 1.4547738693467336 | 1.4522613065326633 | 0 | 1 |
| 82 | Papua New Guinea | 0 | 10 | [null] | 0.4 | 0.3333333333333333 | 0.24 | 0.26804123711340205 | 0.17525773195876287 | 1.907216494845361 | 2.2268041237113403 | [null] | [null] |
| 83 | Vietnam Republic | 0 | 9 | [null] | 0.1111111111111111 | 0.6153846153846154 | 0.3904761904761905 | 0.43137254901960786 | 0.17647058823529413 | 1.8366013071895424 | 1.7320261437908497 | [null] | [null] |
| 84 | Benin | 0 | 50 | [null] | 0.24 | 0.27631578947368424 | 0.13725490196078433 | 0.20614035087719298 | 0.22807017543859648 | 1.0043859649122806 | 1.9517543859649122 | [null] | [null] |
| 85 | Tunisia | 15 | 161 | 0.13333333333333333 | 0.4472049689440994 | 0.531578947368421 | 0.2777777777777778 | 0.4166666666666667 | 0.2916666666666667 | 1.433712121212121 | 1.0643939393939394 | 0 | 1 |
| 86 | Eswatini | 0 | 19 | [null] | 0.21052631578947367 | 0.24096385542168675 | 0.17708333333333334 | 0.20707070707070707 | 0.2727272727272727 | 0.8282828282828283 | 1.7424242424242424 | [null] | [null] |
| 87 | Mauritius | 0 | 21 | [null] | 0.047619047619047616 | 0.35294117647058826 | 0.2903225806451613 | 0.2863849765258216 | 0.2112676056338028 | 1.3286384976525822 | 1.699530516431925 | [null] | [null] |
| 88 | Seychelles | 0 | 14 | [null] | 0.0 | 0.4166666666666667 | 0.0425531914893617 | 0.1411764705882353 | 0.1411764705882353 | 0.7294117647058823 | 2.0588235294117645 | [null] | [null] |
| 89 | San Marino | 0 | 56 | [null] | 0.0 | 0.024390243902439025 | 0.0 | 0.007462686567164179 | 0.029850746268656716 | 0.15671641791044777 | 4.268656716417911 | [null] | [null] |
| 90 | Saare County | 0 | 0 | [null] | [null] | [null] | 0.12903225806451613 | 0.12903225806451613 | 0.0967741935483871 | 1.032258064516129 | 2.6129032258064515 | [null] | [null] |
| 91 | Greenland | 0 | 0 | [null] | [null] | 0.0 | 0.3125 | 0.30303030303030304 | 0.10606060606060606 | 1.7424242424242424 | 2.090909090909091 | [null] | [null] |
| 92 | Basque Country | 0 | 0 | [null] | [null] | 0.6333333333333333 | 0.6956521739130435 | 0.660377358490566 | 0.16981132075471697 | 2.7547169811320753 | 1.3396226415094339 | [null] | [null] |
| 93 | Kyrgyzstan | 0 | 30 | [null] | 0.36666666666666664 | 0.4444444444444444 | 0.15942028985507245 | 0.24074074074074073 | 0.1574074074074074 | 0.9166666666666666 | 1.8611111111111112 | [null] | [null] |
| 94 | Orkney | 0 | 0 | [null] | [null] | [null] | 0.15384615384615385 | 0.15384615384615385 | 0.0 | 1.0 | 4.3076923076923075 | [null] | [null] |
| 95 | Chinese Taipei | 0 | 35 | [null] | 0.11428571428571428 | 0.5 | 0.25316455696202533 | 0.21551724137931033 | 0.15517241379310345 | 1.3189655172413792 | 2.853448275862069 | [null] | [null] |
| 96 | Székely Land | 0 | 0 | [null] | [null] | 0.0 | [null] | 0.0 | 0.0 | 1.0 | 3.0 | [null] | [null] |
| 97 | Chile | 33 | 301 | 0.3333333333333333 | 0.3754152823920266 | 0.558282208588957 | 0.2571428571428571 | 0.38048090523338046 | 0.2065063649222065 | 1.4214992927864214 | 1.4653465346534653 | 0 | 2 |
| 98 | Scotland | 23 | 121 | 0.17391304347826086 | 0.48760330578512395 | 0.5847750865051903 | 0.3942307692307692 | 0.47651006711409394 | 0.2174496644295302 | 1.7503355704697987 | 1.225503355704698 | [null] | [null] |
| 99 | Sierra Leone | 0 | 50 | [null] | 0.24 | 0.5416666666666666 | 0.19491525423728814 | 0.30833333333333335 | 0.24166666666666667 | 0.9583333333333334 | 1.3625 | [null] | [null] |
| 100 | Uganda | 0 | 52 | [null] | 0.3076923076923077 | 0.5919540229885057 | 0.3827893175074184 | 0.4404973357015986 | 0.2539964476021314 | 1.6181172291296626 | 1.211367673179396 | [null] | [null] |
Let’s add each team’s confederation to our dataset.
teams_kpi = teams_kpi.join(
confederation,
how = "left",
on = {"team1": "team"},
expr2 = ["confederation"],
)
teams_kpi.head(100)
Abc team1Varchar(50) | 123 Number_Games_World_TournamentBigint | 123 Number_Games_Continental_TournamentBigint | 123 Percent_Victory_World_TournamentDouble | 123 Percent_Victory_Continental_TournamentDouble | 123 Percent_Victory_HomeDouble | 123 Percent_Victory_AwayDouble | 123 Percent_VictoryDouble | 123 Percent_DrawDouble | 123 Avg_goalsDouble | 123 Avg_goals_concededDouble | 123 nb_World_CupBigint | 123 nb_Continental_CupBigint | Abc confederationVarchar(8) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Liberia | 0 | 64 | [null] | 0.25 | 0.4567901234567901 | 0.1 | 0.27111111111111114 | 0.23555555555555555 | 0.8888888888888888 | 1.4088888888888889 | [null] | [null] | CAF |
| 2 | Moldova | 0 | 48 | [null] | 0.10416666666666667 | 0.26666666666666666 | 0.23 | 0.20725388601036268 | 0.23834196891191708 | 0.8808290155440415 | 1.6269430051813472 | [null] | [null] | UEFA |
| 3 | Senegal | 5 | 106 | 0.4 | 0.3584905660377358 | 0.648 | 0.3360655737704918 | 0.42291666666666666 | 0.26875 | 1.2875 | 1.0020833333333334 | [null] | [null] | CAF |
| 4 | Guatemala | 0 | 139 | [null] | 0.33093525179856115 | 0.46808510638297873 | 0.2857142857142857 | 0.3412322274881517 | 0.25829383886255924 | 1.3293838862559242 | 1.3696682464454977 | [null] | [null] | CONCACAF |
| 5 | Hong Kong | 0 | 82 | [null] | 0.2804878048780488 | 0.43333333333333335 | 0.3005464480874317 | 0.3295774647887324 | 0.21971830985915494 | 1.5295774647887324 | 1.684507042253521 | [null] | [null] | AFC |
| 6 | Japan | 33 | 152 | 0.2727272727272727 | 0.5526315789473685 | 0.5263157894736842 | 0.4009433962264151 | 0.47183098591549294 | 0.23415492957746478 | 1.7200704225352113 | 1.1602112676056338 | 0 | 4 | AFC |
| 7 | Thailand | 0 | 97 | [null] | 0.24742268041237114 | 0.5642201834862385 | 0.259927797833935 | 0.36993243243243246 | 0.22972972972972974 | 1.5456081081081081 | 1.5945945945945945 | [null] | [null] | AFC |
| 8 | United Arab Emirates | 6 | 123 | 0.16666666666666666 | 0.3983739837398374 | 0.4768211920529801 | 0.3368421052631579 | 0.39574468085106385 | 0.24893617021276596 | 1.4148936170212767 | 1.2851063829787235 | [null] | [null] | AFC |
| 9 | Namibia | 0 | 49 | [null] | 0.1836734693877551 | 0.35185185185185186 | 0.19540229885057472 | 0.23684210526315788 | 0.28421052631578947 | 1.0157894736842106 | 1.5315789473684212 | [null] | [null] | CAF |
| 10 | South Sudan | 0 | 2 | [null] | 0.0 | 0.5 | 0.14285714285714285 | 0.16666666666666666 | 0.2777777777777778 | 0.5555555555555556 | 1.5555555555555556 | [null] | [null] | CAF |
| 11 | Shetland | 0 | 0 | [null] | [null] | 0.6 | 0.34210526315789475 | 0.37209302325581395 | 0.16279069767441862 | 1.627906976744186 | 1.8604651162790697 | [null] | [null] | OFC |
| 12 | Falkland Islands | 0 | 0 | [null] | [null] | [null] | 0.24 | 0.24 | 0.0 | 1.0 | 3.8 | [null] | [null] | OFC |
| 13 | Bosnia and Herzegovina | 3 | 48 | 0.3333333333333333 | 0.4791666666666667 | 0.42857142857142855 | 0.3048780487804878 | 0.38461538461538464 | 0.21428571428571427 | 1.4285714285714286 | 1.39010989010989 | [null] | [null] | UEFA |
| 14 | Syria | 0 | 85 | [null] | 0.4470588235294118 | 0.43137254901960786 | 0.33181818181818185 | 0.37359550561797755 | 0.23314606741573032 | 1.4803370786516854 | 1.3314606741573034 | [null] | [null] | AFC |
| 15 | Luxembourg | 0 | 124 | [null] | 0.03225806451612903 | 0.11029411764705882 | 0.058823529411764705 | 0.06906077348066299 | 0.11878453038674033 | 0.5662983425414365 | 2.8121546961325965 | [null] | [null] | UEFA |
| 16 | Albania | 0 | 94 | [null] | 0.14893617021276595 | 0.40425531914893614 | 0.17307692307692307 | 0.23972602739726026 | 0.2226027397260274 | 0.9006849315068494 | 1.595890410958904 | [null] | [null] | UEFA |
| 17 | Tamil Eelam | 0 | 0 | [null] | [null] | [null] | 0.16666666666666666 | 0.16666666666666666 | 0.0 | 1.0 | 4.166666666666667 | [null] | [null] | OFC |
| 18 | Samoa | 0 | 10 | [null] | 0.3 | 0.47058823529411764 | 0.23529411764705882 | 0.3409090909090909 | 0.09090909090909091 | 1.5454545454545454 | 2.9545454545454546 | [null] | [null] | OFC |
| 19 | Comoros | 0 | 8 | [null] | 0.0 | 0.0 | 0.14285714285714285 | 0.07142857142857142 | 0.2857142857142857 | 0.5 | 1.7142857142857142 | [null] | [null] | CAF |
| 20 | Montserrat | 0 | 9 | [null] | 0.0 | 1.0 | 0.10526315789473684 | 0.13333333333333333 | 0.06666666666666667 | 1.0333333333333334 | 4.4 | [null] | [null] | OFC |
| 21 | Iraqi Kurdistan | 0 | 0 | [null] | [null] | 1.0 | 0.35294117647058826 | 0.45 | 0.25 | 2.1 | 1.15 | [null] | [null] | OFC |
| 22 | Corsica | 0 | 0 | [null] | [null] | 0.4 | [null] | 0.4 | 0.4 | 0.8 | 0.6 | [null] | [null] | OFC |
| 23 | Zanzibar | 0 | 0 | [null] | [null] | 0.1724137931034483 | 0.19047619047619047 | 0.18781725888324874 | 0.19289340101522842 | 0.8883248730964467 | 2.1624365482233503 | [null] | [null] | OFC |
| 24 | Ivory Coast | 11 | 160 | 0.2727272727272727 | 0.49375 | 0.6917293233082706 | 0.4 | 0.5029469548133595 | 0.24950884086444008 | 1.6345776031434185 | 1.0530451866404715 | 0 | 2 | CAF |
| 25 | Lesotho | 0 | 24 | [null] | 0.08333333333333333 | 0.21686746987951808 | 0.1509433962264151 | 0.16901408450704225 | 0.30985915492957744 | 0.7793427230046949 | 1.619718309859155 | [null] | [null] | CAF |
| 26 | Silesia | 0 | 0 | [null] | [null] | 0.375 | [null] | 0.375 | 0.25 | 3.0 | 2.125 | [null] | [null] | OFC |
| 27 | Bermuda | 0 | 33 | [null] | 0.42424242424242425 | 0.40384615384615385 | 0.24444444444444444 | 0.35384615384615387 | 0.18461538461538463 | 1.676923076923077 | 1.5615384615384615 | [null] | [null] | CONCACAF |
| 28 | Grenada | 0 | 27 | [null] | 0.25925925925925924 | 0.4 | 0.35398230088495575 | 0.3526315789473684 | 0.22105263157894736 | 1.7894736842105263 | 1.763157894736842 | [null] | [null] | CONCACAF |
| 29 | Jamaica | 3 | 128 | 0.3333333333333333 | 0.34375 | 0.5304878048780488 | 0.30973451327433627 | 0.3877159309021113 | 0.22840690978886757 | 1.3186180422264875 | 1.3378119001919386 | [null] | [null] | CONMEBOL |
| 30 | Dominica | 0 | 17 | [null] | 0.11764705882352941 | 0.475 | 0.1574074074074074 | 0.23030303030303031 | 0.20606060606060606 | 1.1393939393939394 | 2.090909090909091 | [null] | [null] | OFC |
| 31 | Malaysia | 0 | 65 | [null] | 0.27692307692307694 | 0.42702702702702705 | 0.3023255813953488 | 0.3411978221415608 | 0.25226860254083483 | 1.4972776769509981 | 1.5698729582577133 | [null] | [null] | AFC |
| 32 | Cambodia | 0 | 30 | [null] | 0.1 | 0.391304347826087 | 0.18461538461538463 | 0.19672131147540983 | 0.15300546448087432 | 1.1092896174863387 | 2.6557377049180326 | [null] | [null] | AFC |
| 33 | Abkhazia | 0 | 0 | [null] | [null] | [null] | 0.16666666666666666 | 0.16666666666666666 | 0.5 | 1.0 | 1.5 | [null] | [null] | OFC |
| 34 | Bonaire | 0 | 0 | [null] | [null] | [null] | 0.3076923076923077 | 0.3076923076923077 | 0.15384615384615385 | 1.6153846153846154 | 3.3846153846153846 | [null] | [null] | OFC |
| 35 | Nigeria | 24 | 182 | 0.2916666666666667 | 0.5439560439560439 | 0.6203703703703703 | 0.319047619047619 | 0.4580152671755725 | 0.2958015267175573 | 1.4961832061068703 | 1.0038167938931297 | 0 | 5 | CAF |
| 36 | Kuwait | 3 | 133 | 0.0 | 0.47368421052631576 | 0.4573170731707317 | 0.37916666666666665 | 0.42407407407407405 | 0.2722222222222222 | 1.5555555555555556 | 1.0796296296296297 | 0 | 1 | AFC |
| 37 | Cayman Islands | 0 | 14 | [null] | 0.0 | 0.3333333333333333 | 0.13513513513513514 | 0.18518518518518517 | 0.16049382716049382 | 1.037037037037037 | 2.54320987654321 | [null] | [null] | OFC |
| 38 | Slovenia | 6 | 55 | 0.16666666666666666 | 0.38181818181818183 | 0.4264705882352941 | 0.2857142857142857 | 0.352112676056338 | 0.2347417840375587 | 1.2394366197183098 | 1.272300469483568 | [null] | [null] | UEFA |
| 39 | Brazil | 137 | 279 | 0.6788321167883211 | 0.5770609318996416 | 0.7333333333333333 | 0.59375 | 0.635091496232508 | 0.20021528525296017 | 2.193756727664155 | 0.93756727664155 | 4 | 9 | CONMEBOL |
| 40 | Canada | 6 | 144 | 0.0 | 0.3888888888888889 | 0.3387096774193548 | 0.2814814814814815 | 0.3314121037463977 | 0.23919308357348704 | 1.0489913544668588 | 1.3976945244956773 | 0 | 1 | CONCACAF |
| 41 | Iran | 12 | 175 | 0.08333333333333333 | 0.5942857142857143 | 0.6415094339622641 | 0.43037974683544306 | 0.5343680709534369 | 0.2616407982261641 | 1.8403547671840355 | 0.835920177383592 | 0 | 2 | AFC |
| 42 | Cameroon | 31 | 154 | 0.25806451612903225 | 0.564935064935065 | 0.5882352941176471 | 0.32057416267942584 | 0.44258872651356995 | 0.30062630480167013 | 1.4217118997912317 | 1.0542797494780793 | 0 | 2 | CAF |
| 43 | Gotland | 0 | 0 | [null] | [null] | 0.6 | 0.2857142857142857 | 0.34615384615384615 | 0.15384615384615385 | 2.4615384615384617 | 2.0 | [null] | [null] | OFC |
| 44 | Lithuania | 0 | 63 | [null] | 0.25396825396825395 | 0.4090909090909091 | 0.24293785310734464 | 0.2896341463414634 | 0.18902439024390244 | 1.0975609756097562 | 1.7835365853658536 | [null] | [null] | UEFA |
| 45 | Saint Martin | 0 | 0 | [null] | [null] | 0.75 | 0.16 | 0.30303030303030304 | 0.09090909090909091 | 1.121212121212121 | 2.909090909090909 | [null] | [null] | OFC |
| 46 | Trinidad and Tobago | 3 | 145 | 0.0 | 0.3793103448275862 | 0.6224489795918368 | 0.3763440860215054 | 0.45264847512038525 | 0.2102728731942215 | 1.739967897271268 | 1.274478330658106 | [null] | [null] | CONCACAF |
| 47 | United States | 48 | 215 | 0.2916666666666667 | 0.5674418604651162 | 0.40654205607476634 | 0.2620689655172414 | 0.41961414790996787 | 0.21221864951768488 | 1.4196141479099678 | 1.3713826366559485 | 0 | 4 | CONMEBOL |
| 48 | Western Australia | 0 | 0 | [null] | [null] | [null] | 0.3103448275862069 | 0.3103448275862069 | 0.10344827586206896 | 1.896551724137931 | 2.3793103448275863 | [null] | [null] | [null] |
| 49 | Western Isles | 0 | 0 | [null] | [null] | [null] | 0.45 | 0.45 | 0.1 | 1.75 | 2.2 | [null] | [null] | OFC |
| 50 | Ynys Môn | 0 | 0 | [null] | [null] | [null] | 0.47058823529411764 | 0.47058823529411764 | 0.21568627450980393 | 1.7058823529411764 | 1.4901960784313726 | [null] | [null] | OFC |
| 51 | British Virgin Islands | 0 | 9 | [null] | 0.0 | 0.36363636363636365 | 0.16 | 0.19753086419753085 | 0.16049382716049382 | 0.8765432098765432 | 3.111111111111111 | [null] | [null] | OFC |
| 52 | Equatorial Guinea | 0 | 29 | [null] | 0.27586206896551724 | 0.4482758620689655 | 0.06666666666666667 | 0.23300970873786409 | 0.22330097087378642 | 0.7961165048543689 | 1.6504854368932038 | [null] | [null] | CAF |
| 53 | Estonia | 0 | 66 | [null] | 0.19696969696969696 | 0.3618421052631579 | 0.18686868686868688 | 0.25240384615384615 | 0.21394230769230768 | 1.0240384615384615 | 1.78125 | [null] | [null] | UEFA |
| 54 | Guinea | 0 | 110 | [null] | 0.41818181818181815 | 0.65 | 0.2542372881355932 | 0.37089201877934275 | 0.29107981220657275 | 1.363849765258216 | 1.2206572769953052 | [null] | [null] | CAF |
| 55 | Northern Ireland | 13 | 122 | 0.23076923076923078 | 0.30327868852459017 | 0.29017857142857145 | 0.1721311475409836 | 0.24378109452736318 | 0.23217247097844113 | 1.043117744610282 | 1.9535655058043118 | [null] | [null] | UEFA |
| 56 | Northern Mariana Islands | 0 | 0 | [null] | [null] | 0.0 | 0.13333333333333333 | 0.1111111111111111 | 0.05555555555555555 | 0.8888888888888888 | 4.166666666666667 | [null] | [null] | OFC |
| 57 | Slovakia | 4 | 54 | 0.25 | 0.48148148148148145 | 0.45 | 0.3333333333333333 | 0.40160642570281124 | 0.23694779116465864 | 1.4417670682730923 | 1.3012048192771084 | [null] | [null] | UEFA |
| 58 | Tahiti | 3 | 27 | 0.0 | 0.2962962962962963 | 0.4838709677419355 | 0.5846153846153846 | 0.518324607329843 | 0.1256544502617801 | 2.518324607329843 | 1.7015706806282722 | [null] | [null] | OFC |
| 59 | Tanzania | 0 | 40 | [null] | 0.2 | 0.3860759493670886 | 0.23024054982817868 | 0.278118609406953 | 0.28016359918200406 | 1.1513292433537832 | 1.5501022494887526 | [null] | [null] | CAF |
| 60 | Spain | 69 | 143 | 0.5217391304347826 | 0.6223776223776224 | 0.6768558951965066 | 0.46568627450980393 | 0.5813953488372093 | 0.2248062015503876 | 1.9674418604651163 | 0.9085271317829458 | 1 | 3 | UEFA |
| 61 | Kernow | 0 | 0 | [null] | [null] | 0.2857142857142857 | [null] | 0.2857142857142857 | 0.2857142857142857 | 1.7142857142857142 | 2.2857142857142856 | [null] | [null] | OFC |
| 62 | Scotland | 23 | 121 | 0.17391304347826086 | 0.48760330578512395 | 0.5847750865051903 | 0.3942307692307692 | 0.47651006711409394 | 0.2174496644295302 | 1.7503355704697987 | 1.225503355704698 | [null] | [null] | UEFA |
| 63 | Argentina | 87 | 302 | 0.5402298850574713 | 0.6059602649006622 | 0.638095238095238 | 0.40606060606060607 | 0.5360602798708288 | 0.24865446716899892 | 1.8654467168998923 | 1.0505920344456405 | 2 | 8 | CONMEBOL |
| 64 | Chile | 33 | 301 | 0.3333333333333333 | 0.3754152823920266 | 0.558282208588957 | 0.2571428571428571 | 0.38048090523338046 | 0.2065063649222065 | 1.4214992927864214 | 1.4653465346534653 | 0 | 2 | CONMEBOL |
| 65 | Switzerland | 33 | 129 | 0.3333333333333333 | 0.4186046511627907 | 0.41333333333333333 | 0.22758620689655173 | 0.3390957446808511 | 0.21675531914893617 | 1.4414893617021276 | 1.7313829787234043 | [null] | [null] | UEFA |
| 66 | Uganda | 0 | 52 | [null] | 0.3076923076923077 | 0.5919540229885057 | 0.3827893175074184 | 0.4404973357015986 | 0.2539964476021314 | 1.6181172291296626 | 1.211367673179396 | [null] | [null] | CAF |
| 67 | Isle of Wight | 0 | 0 | [null] | [null] | 0.7777777777777778 | 0.4411764705882353 | 0.5116279069767442 | 0.16279069767441862 | 2.0 | 1.302325581395349 | [null] | [null] | OFC |
| 68 | Cuba | 3 | 92 | 0.3333333333333333 | 0.25 | 0.45 | 0.3728813559322034 | 0.34615384615384615 | 0.25 | 1.3205128205128205 | 1.439102564102564 | [null] | [null] | CONCACAF |
| 69 | Vietnam | 0 | 39 | [null] | 0.23076923076923078 | 0.46551724137931033 | 0.38461538461538464 | 0.3765432098765432 | 0.2037037037037037 | 1.6666666666666667 | 1.5925925925925926 | [null] | [null] | AFC |
| 70 | Suriname | 0 | 61 | [null] | 0.3114754098360656 | 0.6320754716981132 | 0.35185185185185186 | 0.43465045592705165 | 0.23708206686930092 | 1.9331306990881458 | 1.452887537993921 | [null] | [null] | OFC |
| 71 | Sierra Leone | 0 | 50 | [null] | 0.24 | 0.5416666666666666 | 0.19491525423728814 | 0.30833333333333335 | 0.24166666666666667 | 0.9583333333333334 | 1.3625 | [null] | [null] | CAF |
| 72 | Chad | 0 | 16 | [null] | 0.375 | 0.3181818181818182 | 0.16176470588235295 | 0.22641509433962265 | 0.24528301886792453 | 0.9339622641509434 | 1.7358490566037736 | [null] | [null] | CAF |
| 73 | Bahamas | 0 | 13 | [null] | 0.3076923076923077 | 0.3333333333333333 | 0.18181818181818182 | 0.25925925925925924 | 0.14814814814814814 | 1.1481481481481481 | 3.3333333333333335 | [null] | [null] | OFC |
| 74 | Monaco | 0 | 0 | [null] | [null] | [null] | 0.16666666666666666 | 0.16666666666666666 | 0.16666666666666666 | 1.1666666666666667 | 8.333333333333334 | [null] | [null] | OFC |
| 75 | Galicia | 0 | 0 | [null] | [null] | 0.5 | [null] | 0.5 | 0.5 | 2.0 | 1.5 | [null] | [null] | OFC |
| 76 | Brittany | 0 | 0 | [null] | [null] | 0.5555555555555556 | [null] | 0.5555555555555556 | 0.2222222222222222 | 1.4444444444444444 | 1.2222222222222223 | [null] | [null] | OFC |
| 77 | Burundi | 0 | 20 | [null] | 0.35 | 0.37037037037037035 | 0.2972972972972973 | 0.31645569620253167 | 0.24050632911392406 | 1.0379746835443038 | 1.2974683544303798 | [null] | [null] | CAF |
| 78 | Angola | 3 | 84 | 0.0 | 0.3333333333333333 | 0.5625 | 0.2535211267605634 | 0.35275080906148865 | 0.35275080906148865 | 1.174757281553398 | 1.0420711974110033 | [null] | [null] | CAF |
| 79 | Saint Kitts and Nevis | 0 | 26 | [null] | 0.34615384615384615 | 0.5076923076923077 | 0.3064516129032258 | 0.39869281045751637 | 0.1895424836601307 | 1.7973856209150327 | 1.5947712418300655 | [null] | [null] | OFC |
| 80 | Guyana | 0 | 32 | [null] | 0.21875 | 0.3870967741935484 | 0.2564102564102564 | 0.30165289256198347 | 0.2066115702479339 | 1.1983471074380165 | 1.7479338842975207 | [null] | [null] | CONCACAF |
| 81 | China PR | 3 | 147 | 0.0 | 0.5510204081632653 | 0.5796178343949044 | 0.3958333333333333 | 0.48811700182815354 | 0.226691042047532 | 1.8372943327239488 | 1.0877513711151736 | [null] | [null] | AFC |
| 82 | Jordan | 0 | 78 | [null] | 0.38461538461538464 | 0.411214953271028 | 0.28662420382165604 | 0.347953216374269 | 0.28654970760233917 | 1.1842105263157894 | 1.1140350877192982 | [null] | [null] | AFC |
| 83 | Turkmenistan | 0 | 41 | [null] | 0.36585365853658536 | 0.5384615384615384 | 0.36507936507936506 | 0.38461538461538464 | 0.17094017094017094 | 1.6324786324786325 | 1.4786324786324787 | [null] | [null] | AFC |
| 84 | Cyprus | 0 | 104 | [null] | 0.11538461538461539 | 0.3014705882352941 | 0.09090909090909091 | 0.18597560975609756 | 0.1676829268292683 | 0.8689024390243902 | 2.2469512195121952 | [null] | [null] | UEFA |
| 85 | Faroe Islands | 0 | 60 | [null] | 0.08333333333333333 | 0.25925925925925924 | 0.1875 | 0.17525773195876287 | 0.08762886597938144 | 0.8350515463917526 | 2.5257731958762886 | [null] | [null] | UEFA |
| 86 | Russia | 40 | 144 | 0.425 | 0.5902777777777778 | 0.5932203389830508 | 0.45614035087719296 | 0.521671826625387 | 0.2647058823529412 | 1.7198142414860682 | 0.93343653250774 | 0 | 1 | UEFA |
| 87 | Norway | 8 | 118 | 0.25 | 0.3474576271186441 | 0.3948220064724919 | 0.3343465045592705 | 0.3599476439790576 | 0.22774869109947643 | 1.5013089005235603 | 1.6845549738219896 | [null] | [null] | UEFA |
| 88 | Mayotte | 0 | 0 | [null] | [null] | 0.0 | 0.1875 | 0.16666666666666666 | 0.2777777777777778 | 1.6111111111111112 | 2.0555555555555554 | [null] | [null] | OFC |
| 89 | Réunion | 0 | 0 | [null] | [null] | 0.21212121212121213 | 0.4166666666666667 | 0.3333333333333333 | 0.16049382716049382 | 1.6666666666666667 | 2.3580246913580245 | [null] | [null] | OFC |
| 90 | Mongolia | 0 | 14 | [null] | 0.21428571428571427 | 1.0 | 0.2413793103448276 | 0.26666666666666666 | 0.08888888888888889 | 1.0888888888888888 | 3.2222222222222223 | [null] | [null] | OFC |
| 91 | Malta | 0 | 92 | [null] | 0.021739130434782608 | 0.20666666666666667 | 0.1016949152542373 | 0.125 | 0.16666666666666666 | 0.6277777777777778 | 2.3055555555555554 | [null] | [null] | UEFA |
| 92 | Peru | 15 | 277 | 0.26666666666666666 | 0.3176895306859206 | 0.42857142857142855 | 0.2236024844720497 | 0.3129370629370629 | 0.243006993006993 | 1.229020979020979 | 1.4685314685314685 | 0 | 2 | CONMEBOL |
| 93 | Cape Verde | 0 | 35 | [null] | 0.34285714285714286 | 0.5806451612903226 | 0.27848101265822783 | 0.3586206896551724 | 0.23448275862068965 | 1.0620689655172413 | 1.1586206896551725 | [null] | [null] | CAF |
| 94 | Libya | 0 | 62 | [null] | 0.3709677419354839 | 0.5876288659793815 | 0.23357664233576642 | 0.3783783783783784 | 0.24662162162162163 | 1.2905405405405406 | 1.2162162162162162 | [null] | [null] | CAF |
| 95 | Rhodes | 0 | 0 | [null] | [null] | 0.6666666666666666 | 0.6 | 0.6111111111111112 | 0.1111111111111111 | 1.6111111111111112 | 1.0555555555555556 | [null] | [null] | OFC |
| 96 | Dominican Republic | 0 | 28 | [null] | 0.35714285714285715 | 0.42857142857142855 | 0.3333333333333333 | 0.3626373626373626 | 0.14285714285714285 | 1.5714285714285714 | 1.8571428571428572 | [null] | [null] | OFC |
| 97 | Ellan Vannin | 0 | 0 | [null] | [null] | [null] | 0.0 | 0.0 | 0.6666666666666666 | 0.6666666666666666 | 1.0 | [null] | [null] | OFC |
| 98 | Kiribati | 0 | 0 | [null] | [null] | [null] | 0.0 | 0.0 | 0.0 | 0.3333333333333333 | 9.666666666666666 | [null] | [null] | OFC |
| 99 | Mauritania | 0 | 18 | [null] | 0.1111111111111111 | 0.3 | 0.08571428571428572 | 0.15028901734104047 | 0.26011560693641617 | 0.7341040462427746 | 1.6416184971098267 | [null] | [null] | CAF |
| 100 | São Tomé and Príncipe | 0 | 8 | [null] | 0.25 | 0.2222222222222222 | 0.0625 | 0.15151515151515152 | 0.15151515151515152 | 0.7575757575757576 | 2.5757575757575757 | [null] | [null] | CAF |
Since clustering will use different statistics, we need to normalize the data. We’ll also create a dummy that will equal 1 if the team won at least one World Cup.
teams_kpi.normalize(
columns = [
"Number_Games_Continental_Tournament",
"Number_Games_World_Tournament",
"nb_Continental_Cup",
],
method = "minmax",
)
teams_kpi["Word_Cup_Victory"] = teams_kpi["nb_World_Cup"] > 0
teams_kpi["Word_Cup_Victory"].astype("int")
Abc team1Varchar(50) | 123 Number_Games_World_TournamentReal | 123 Number_Games_Continental_TournamentReal | 123 Percent_Victory_World_TournamentDouble | 123 Percent_Victory_Continental_TournamentDouble | 123 Percent_Victory_HomeDouble | 123 Percent_Victory_AwayDouble | 123 Percent_VictoryDouble | 123 Percent_DrawDouble | 123 Avg_goalsDouble | 123 Avg_goals_concededDouble | 123 nb_World_CupBigint | 123 nb_Continental_CupReal | Abc confederationVarchar(8) | 123 Word_Cup_VictoryInt | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Brazil | 1.0 | 0.8403614 | 0.6788321167883211 | 0.5770609318996416 | 0.7333333333333333 | 0.59375 | 0.635091496232508 | 0.20021528525296017 | 2.193756727664155 | 0.93756727664155 | 4 | 0.8 | CONMEBOL | 1 |
| 2 | Nigeria | 0.1751825 | 0.5481928 | 0.2916666666666667 | 0.5439560439560439 | 0.6203703703703703 | 0.319047619047619 | 0.4580152671755725 | 0.2958015267175573 | 1.4961832061068703 | 1.0038167938931297 | 0 | 0.3 | CAF | 0 |
| 3 | Cameroon | 0.2262774 | 0.4638554 | 0.25806451612903225 | 0.564935064935065 | 0.5882352941176471 | 0.32057416267942584 | 0.44258872651356995 | 0.30062630480167013 | 1.4217118997912317 | 1.0542797494780793 | 0 | 0.2 | CAF | 0 |
| 4 | Kuwait | 0.0218978 | 0.4006024 | 0.0 | 0.47368421052631576 | 0.4573170731707317 | 0.37916666666666665 | 0.42407407407407405 | 0.2722222222222222 | 1.5555555555555556 | 1.0796296296296297 | 0 | 0.1 | AFC | 0 |
| 5 | Iran | 0.0875912 | 0.5271084 | 0.08333333333333333 | 0.5942857142857143 | 0.6415094339622641 | 0.43037974683544306 | 0.5343680709534369 | 0.2616407982261641 | 1.8403547671840355 | 0.835920177383592 | 0 | 0.2 | AFC | 0 |
| 6 | Slovenia | 0.0437956 | 0.1656627 | 0.16666666666666666 | 0.38181818181818183 | 0.4264705882352941 | 0.2857142857142857 | 0.352112676056338 | 0.2347417840375587 | 1.2394366197183098 | 1.272300469483568 | [null] | [null] | UEFA | [null] |
| 7 | Canada | 0.0437956 | 0.4337349 | 0.0 | 0.3888888888888889 | 0.3387096774193548 | 0.2814814814814815 | 0.3314121037463977 | 0.23919308357348704 | 1.0489913544668588 | 1.3976945244956773 | 0 | 0.2 | CONCACAF | 0 |
| 8 | Lithuania | 0.0 | 0.189759 | [null] | 0.25396825396825395 | 0.4090909090909091 | 0.24293785310734464 | 0.2896341463414634 | 0.18902439024390244 | 1.0975609756097562 | 1.7835365853658536 | [null] | [null] | UEFA | [null] |
| 9 | Cayman Islands | 0.0 | 0.0421687 | [null] | 0.0 | 0.3333333333333333 | 0.13513513513513514 | 0.18518518518518517 | 0.16049382716049382 | 1.037037037037037 | 2.54320987654321 | [null] | [null] | OFC | [null] |
| 10 | Saint Martin | 0.0 | 0.0 | [null] | [null] | 0.75 | 0.16 | 0.30303030303030304 | 0.09090909090909091 | 1.121212121212121 | 2.909090909090909 | [null] | [null] | OFC | [null] |
| 11 | Gotland | 0.0 | 0.0 | [null] | [null] | 0.6 | 0.2857142857142857 | 0.34615384615384615 | 0.15384615384615385 | 2.4615384615384617 | 2.0 | [null] | [null] | OFC | [null] |
| 12 | Sudan | 0.0 | 0.2620482 | [null] | 0.25287356321839083 | 0.5921052631578947 | 0.2783018867924528 | 0.336 | 0.248 | 1.1413333333333333 | 1.368 | [null] | [null] | CAF | [null] |
| 13 | Niger | 0.0 | 0.1084337 | [null] | 0.25 | 0.4482758620689655 | 0.0898876404494382 | 0.23497267759562843 | 0.2568306010928962 | 0.9344262295081968 | 1.644808743169399 | [null] | [null] | CAF | [null] |
| 14 | New Zealand | 0.1094891 | 0.2168675 | 0.0 | 0.5416666666666666 | 0.4868421052631579 | 0.3468208092485549 | 0.40476190476190477 | 0.18154761904761904 | 1.7470238095238095 | 1.6130952380952381 | [null] | [null] | OFC | [null] |
| 15 | Catalonia | 0.0 | 0.0 | [null] | [null] | 0.4594594594594595 | 0.1111111111111111 | 0.391304347826087 | 0.2391304347826087 | 1.5217391304347827 | 1.7391304347826086 | [null] | [null] | OFC | [null] |
| 16 | Ecuador | 0.0729927 | 0.7349398 | 0.4 | 0.2459016393442623 | 0.59375 | 0.24025974025974026 | 0.2944915254237288 | 0.2457627118644068 | 1.194915254237288 | 1.6504237288135593 | 0 | 0.1 | CONMEBOL | 0 |
| 17 | South Korea | 0.2481752 | 0.5783133 | 0.20588235294117646 | 0.5625 | 0.5789473684210527 | 0.5122615803814714 | 0.5286783042394015 | 0.256857855361596 | 1.7830423940149627 | 0.8977556109725686 | 0 | 0.3 | AFC | 0 |
| 18 | Nepal | 0.0 | 0.0903614 | [null] | 0.13333333333333333 | 0.39473684210526316 | 0.14634146341463414 | 0.20666666666666667 | 0.14 | 0.8133333333333334 | 2.5866666666666664 | [null] | [null] | AFC | [null] |
| 19 | Iceland | 0.0 | 0.2891566 | [null] | 0.21875 | 0.4307692307692308 | 0.23780487804878048 | 0.29743589743589743 | 0.18974358974358974 | 1.1641025641025642 | 1.7 | [null] | [null] | UEFA | [null] |
| 20 | Eritrea | 0.0 | 0.0240964 | [null] | 0.0 | 0.4166666666666667 | 0.12 | 0.15714285714285714 | 0.22857142857142856 | 0.6714285714285714 | 1.7428571428571429 | [null] | [null] | CAF | [null] |
Some data is missing; this is because only top teams won major tournaments. Besides, some non-professional teams may not have a stadium.
teams_kpi.count()
| count | |
|---|---|
| "team1" | 272.0 |
| "Number_Games_World_Tournament" | 272.0 |
| "Number_Games_Continental_Tournament" | 272.0 |
| "Percent_Victory_World_Tournament" | 77.0 |
| "Percent_Victory_Continental_Tournament" | 213.0 |
| "Percent_Victory_Home" | 243.0 |
| "Percent_Victory_Away" | 263.0 |
| "Percent_Victory" | 272.0 |
| "Percent_Draw" | 272.0 |
| "Avg_goals" | 272.0 |
| "Avg_goals_conceded" | 272.0 |
| "nb_World_Cup" | 40.0 |
| "nb_Continental_Cup" | 40.0 |
| "confederation" | 271.0 |
| "Word_Cup_Victory" | 40.0 |
Let’s impute the missing values by 0.
teams_kpi.fillna(
{
"Percent_Victory_Away": 0,
"Percent_Victory_Home": 0,
"Percent_Victory_Continental_Tournament": 0,
"Percent_Victory_World_Tournament": 0,
"nb_World_Cup": 0,
"Word_Cup_Victory": 0,
"nb_Continental_Cup": 0,
"confederation": "OFC",
},
)
Abc team1Varchar(50) | 123 Number_Games_World_TournamentReal | 123 Number_Games_Continental_TournamentReal | 123 Percent_Victory_World_TournamentReal | 123 Percent_Victory_Continental_TournamentReal | 123 Percent_Victory_HomeReal | 123 Percent_Victory_AwayReal | 123 Percent_VictoryDouble | 123 Percent_DrawDouble | 123 Avg_goalsDouble | 123 Avg_goals_concededDouble | 123 nb_World_CupBigint | 123 nb_Continental_CupReal | Abc confederationVarchar(8) | 123 Word_Cup_VictoryInt | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | El Salvador | 0.0437956 | 0.4698795 | 0.0 | 0.4166666666666667 | 0.4819277108433735 | 0.2009132420091324 | 0.32112068965517243 | 0.22629310344827586 | 1.2262931034482758 | 1.4870689655172413 | 0 | 0.0 | CONCACAF | 0 |
| 2 | Czech Republic | 0.2773723 | 0.4668675 | 0.3684210526315789 | 0.5290322580645161 | 0.654320987654321 | 0.34185303514376997 | 0.4833110814419226 | 0.22162883845126835 | 1.843791722296395 | 1.2349799732977302 | 0 | 0.0 | UEFA | 0 |
| 3 | Wales | 0.0364964 | 0.3313253 | 0.2 | 0.3 | 0.3670886075949367 | 0.26515151515151514 | 0.31006493506493504 | 0.21266233766233766 | 1.2532467532467533 | 1.6931818181818181 | 0 | 0.0 | UEFA | 0 |
| 4 | South Africa | 0.1240876 | 0.2560241 | 0.17647058823529413 | 0.4823529411764706 | 0.5275590551181102 | 0.3709677419354839 | 0.4447592067988669 | 0.2747875354107649 | 1.339943342776204 | 1.0084985835694051 | 0 | 0.0 | CAF | 0 |
| 5 | Austria | 0.2116788 | 0.3493976 | 0.41379310344827586 | 0.47413793103448276 | 0.4837662337662338 | 0.30633802816901406 | 0.41112618724559025 | 0.2198100407055631 | 1.7978290366350067 | 1.5929443690637721 | 0 | 0.0 | UEFA | 0 |
| 6 | Argentina | 0.6350365 | 0.9096386 | 0.5402298850574713 | 0.6059602649006622 | 0.638095238095238 | 0.40606060606060607 | 0.5360602798708288 | 0.24865446716899892 | 1.8654467168998923 | 1.0505920344456405 | 2 | 0.8 | CONMEBOL | 1 |
| 7 | Chile | 0.2408759 | 0.9066265 | 0.3333333333333333 | 0.3754152823920266 | 0.558282208588957 | 0.2571428571428571 | 0.38048090523338046 | 0.2065063649222065 | 1.4214992927864214 | 1.4653465346534653 | 0 | 0.2 | CONMEBOL | 0 |
| 8 | Scotland | 0.1678832 | 0.3644578 | 0.17391304347826086 | 0.48760330578512395 | 0.5847750865051903 | 0.3942307692307692 | 0.47651006711409394 | 0.2174496644295302 | 1.7503355704697987 | 1.225503355704698 | 0 | 0.0 | UEFA | 0 |
| 9 | Switzerland | 0.2408759 | 0.3885542 | 0.3333333333333333 | 0.4186046511627907 | 0.41333333333333333 | 0.22758620689655173 | 0.3390957446808511 | 0.21675531914893617 | 1.4414893617021276 | 1.7313829787234043 | 0 | 0.0 | UEFA | 0 |
| 10 | Uganda | 0.0 | 0.1566265 | 0.0 | 0.3076923076923077 | 0.5919540229885057 | 0.3827893175074184 | 0.4404973357015986 | 0.2539964476021314 | 1.6181172291296626 | 1.211367673179396 | 0 | 0.0 | CAF | 0 |
| 11 | Sierra Leone | 0.0 | 0.1506024 | 0.0 | 0.24 | 0.5416666666666666 | 0.19491525423728814 | 0.30833333333333335 | 0.24166666666666667 | 0.9583333333333334 | 1.3625 | 0 | 0.0 | CAF | 0 |
| 12 | Galicia | 0.0 | 0.0 | 0.0 | 0.0 | 0.5 | 0.0 | 0.5 | 0.5 | 2.0 | 1.5 | 0 | 0.0 | OFC | 0 |
| 13 | Cuba | 0.0218978 | 0.2771084 | 0.3333333333333333 | 0.25 | 0.45 | 0.3728813559322034 | 0.34615384615384615 | 0.25 | 1.3205128205128205 | 1.439102564102564 | 0 | 0.0 | CONCACAF | 0 |
| 14 | Chad | 0.0 | 0.0481928 | 0.0 | 0.375 | 0.3181818181818182 | 0.16176470588235295 | 0.22641509433962265 | 0.24528301886792453 | 0.9339622641509434 | 1.7358490566037736 | 0 | 0.0 | CAF | 0 |
| 15 | Brittany | 0.0 | 0.0 | 0.0 | 0.0 | 0.5555555555555556 | 0.0 | 0.5555555555555556 | 0.2222222222222222 | 1.4444444444444444 | 1.2222222222222223 | 0 | 0.0 | OFC | 0 |
| 16 | Bahamas | 0.0 | 0.0391566 | 0.0 | 0.3076923076923077 | 0.3333333333333333 | 0.18181818181818182 | 0.25925925925925924 | 0.14814814814814814 | 1.1481481481481481 | 3.3333333333333335 | 0 | 0.0 | OFC | 0 |
| 17 | Suriname | 0.0 | 0.1837349 | 0.0 | 0.3114754098360656 | 0.6320754716981132 | 0.35185185185185186 | 0.43465045592705165 | 0.23708206686930092 | 1.9331306990881458 | 1.452887537993921 | 0 | 0.0 | OFC | 0 |
| 18 | Vietnam | 0.0 | 0.1174699 | 0.0 | 0.23076923076923078 | 0.46551724137931033 | 0.38461538461538464 | 0.3765432098765432 | 0.2037037037037037 | 1.6666666666666667 | 1.5925925925925926 | 0 | 0.0 | AFC | 0 |
| 19 | Isle of Wight | 0.0 | 0.0 | 0.0 | 0.0 | 0.7777777777777778 | 0.4411764705882353 | 0.5116279069767442 | 0.16279069767441862 | 2.0 | 1.302325581395349 | 0 | 0.0 | OFC | 0 |
| 20 | Monaco | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.16666666666666666 | 0.16666666666666666 | 0.16666666666666666 | 1.1666666666666667 | 8.333333333333334 | 0 | 0.0 | OFC | 0 |
Let’s export the result to our VAST DataBase.
vo.drop("football_clustering", method = "table")
teams_kpi.to_db(
"football_clustering",
relation_type = "table",
inplace = True,
)
Abc team1Varchar(50) | 123 number_games_world_tournamentDecimal(28,7) | 123 number_games_continental_tournamentDecimal(28,7) | 123 percent_victory_world_tournamentDouble | 123 percent_victory_continental_tournamentDouble | 123 percent_victory_homeDouble | 123 percent_victory_awayDouble | 123 percent_victoryDouble | 123 percent_drawDouble | 123 avg_goalsDouble | 123 avg_goals_concededDouble | 123 nb_world_cupBigint | 123 nb_continental_cupDecimal(27,6) | Abc confederationVarchar(8) | 123 word_cup_victoryInteger | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Brazil | 1.0 | 0.8403614 | 0.6788321167883211 | 0.5770609318996416 | 0.7333333333333333 | 0.59375 | 0.635091496232508 | 0.20021528525296017 | 2.193756727664155 | 0.93756727664155 | 4 | 0.9 | CONMEBOL | 1 |
| 2 | Slovenia | 0.0437956 | 0.1656627 | 0.16666666666666666 | 0.38181818181818183 | 0.4264705882352941 | 0.2857142857142857 | 0.352112676056338 | 0.2347417840375587 | 1.2394366197183098 | 1.272300469483568 | 0 | 0.0 | UEFA | 0 |
| 3 | Canada | 0.0437956 | 0.4337349 | 0.0 | 0.3888888888888889 | 0.3387096774193548 | 0.2814814814814815 | 0.3314121037463977 | 0.23919308357348704 | 1.0489913544668588 | 1.3976945244956773 | 0 | 0.1 | CONCACAF | 0 |
| 4 | Gotland | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.2857142857142857 | 0.34615384615384615 | 0.15384615384615385 | 2.4615384615384617 | 2.0 | 0 | 0.0 | OFC | 0 |
| 5 | Saint Martin | 0.0 | 0.0 | 0.0 | 0.0 | 0.75 | 0.16 | 0.30303030303030304 | 0.09090909090909091 | 1.121212121212121 | 2.909090909090909 | 0 | 0.0 | OFC | 0 |
| 6 | Cayman Islands | 0.0 | 0.0421687 | 0.0 | 0.0 | 0.3333333333333333 | 0.13513513513513514 | 0.18518518518518517 | 0.16049382716049382 | 1.037037037037037 | 2.54320987654321 | 0 | 0.0 | OFC | 0 |
| 7 | Iran | 0.0875912 | 0.5271084 | 0.08333333333333333 | 0.5942857142857143 | 0.6415094339622641 | 0.43037974683544306 | 0.5343680709534369 | 0.2616407982261641 | 1.8403547671840355 | 0.835920177383592 | 0 | 0.3 | AFC | 0 |
| 8 | Kuwait | 0.0218978 | 0.4006024 | 0.0 | 0.47368421052631576 | 0.4573170731707317 | 0.37916666666666665 | 0.42407407407407405 | 0.2722222222222222 | 1.5555555555555556 | 1.0796296296296297 | 0 | 0.1 | AFC | 0 |
| 9 | Lithuania | 0.0 | 0.189759 | 0.0 | 0.25396825396825395 | 0.4090909090909091 | 0.24293785310734464 | 0.2896341463414634 | 0.18902439024390244 | 1.0975609756097562 | 1.7835365853658536 | 0 | 0.0 | UEFA | 0 |
| 10 | Nigeria | 0.1751825 | 0.5481928 | 0.2916666666666667 | 0.5439560439560439 | 0.6203703703703703 | 0.319047619047619 | 0.4580152671755725 | 0.2958015267175573 | 1.4961832061068703 | 1.0038167938931297 | 0 | 0.3 | CAF | 0 |
| 11 | Cameroon | 0.2262774 | 0.4638554 | 0.25806451612903225 | 0.564935064935065 | 0.5882352941176471 | 0.32057416267942584 | 0.44258872651356995 | 0.30062630480167013 | 1.4217118997912317 | 1.0542797494780793 | 0 | 0.2 | CAF | 0 |
| 12 | South Korea | 0.2481752 | 0.5783133 | 0.20588235294117646 | 0.5625 | 0.5789473684210527 | 0.5122615803814714 | 0.5286783042394015 | 0.256857855361596 | 1.7830423940149627 | 0.8977556109725686 | 0 | 0.3 | AFC | 0 |
| 13 | New Zealand | 0.1094891 | 0.2168675 | 0.0 | 0.5416666666666666 | 0.4868421052631579 | 0.3468208092485549 | 0.40476190476190477 | 0.18154761904761904 | 1.7470238095238095 | 1.6130952380952381 | 0 | 0.0 | OFC | 0 |
| 14 | Iceland | 0.0 | 0.2891566 | 0.0 | 0.21875 | 0.4307692307692308 | 0.23780487804878048 | 0.29743589743589743 | 0.18974358974358974 | 1.1641025641025642 | 1.7 | 0 | 0.0 | UEFA | 0 |
| 15 | Honduras | 0.0656934 | 0.5271084 | 0.0 | 0.44 | 0.5483870967741935 | 0.3316062176165803 | 0.4085106382978723 | 0.26170212765957446 | 1.4914893617021276 | 1.2234042553191489 | 0 | 0.0 | CONMEBOL | 0 |
| 16 | Ecuador | 0.0729927 | 0.7349398 | 0.4 | 0.2459016393442623 | 0.59375 | 0.24025974025974026 | 0.2944915254237288 | 0.2457627118644068 | 1.194915254237288 | 1.6504237288135593 | 0 | 0.2 | CONMEBOL | 0 |
| 17 | Isle of Man | 0.0 | 0.0 | 0.0 | 0.0 | 0.25 | 0.5555555555555556 | 0.525 | 0.1 | 2.8 | 1.625 | 0 | 0.0 | OFC | 0 |
| 18 | Saint Lucia | 0.0 | 0.0662651 | 0.0 | 0.2727272727272727 | 0.40350877192982454 | 0.308411214953271 | 0.3333333333333333 | 0.13978494623655913 | 1.4731182795698925 | 1.9623655913978495 | 0 | 0.0 | OFC | 0 |
| 19 | Catalonia | 0.0 | 0.0 | 0.0 | 0.0 | 0.4594594594594595 | 0.1111111111111111 | 0.391304347826087 | 0.2391304347826087 | 1.5217391304347827 | 1.7391304347826086 | 0 | 0.0 | OFC | 0 |
| 20 | Sudan | 0.0 | 0.2620482 | 0.0 | 0.25287356321839083 | 0.5921052631578947 | 0.2783018867924528 | 0.336 | 0.248 | 1.1413333333333333 | 1.368 | 0 | 0.0 | CAF | 0 |
Team Rankings with k-means¶
To compute a KMeans model, we need to find a value for k. Let’s draw an elbow() curve to find a suitable number of clusters.
from vastorbit.machine_learning.model_selection import elbow
predictors = [
'Word_Cup_Victory',
'nb_Continental_Cup',
'Number_Games_World_Tournament',
'Number_Games_Continental_Tournament',
'Percent_Victory_World_Tournament',
'Percent_Victory_Continental_Tournament',
'Percent_Victory_Home',
'Percent_Victory_Away',
]
elbow(
"football_clustering",
predictors,
n_clusters = (1, 11),
)
6 seems to be a good number of clusters. To help the algorithm to converge to meaningful clusters, we can initialize the clusters with different types of centroid levels. For example, we can associate very good teams (champions) to World Cups Winners, good teams to continental Cup Winners, etc. This will let us to properly weigh the performance of each team relatve to the strength of their region.
from vastorbit.machine_learning.vast import KMeans
# w_cup c_cup w_games c_games w_vict c_vict h_vict a_vict
init = [
(0, 0, 0, 0.05, 0, 0, 0, 0.05), # very bad
(0, 0, 0, 0.30, 0, 0.25, 0.30, 0.10), # bad
(0, 0, 0.05, 0.40, 0.15, 0.35, 0.40, 0.20), # outsiders
(0, 0.10, 0.15, 0.50, 0.20, 0.45, 0.50, 0.30), # good
(0, 0.20, 0.30, 0.40, 0.40, 0.55, 0.60, 0.40), # strong
(1, 0.5, 1, 0.80, 0.70, 0.65, 0.75, 0.55), # champions
]
model_kmeans = KMeans(
n_clusters = 6,
init = init,
)
model_kmeans.fit("football_clustering", predictors)
model_kmeans.clusters_
Let’s add the prediction to the VastFrame.
model_kmeans.predict(
teams_kpi,
name = "fifa_rank",
)
Abc team1Varchar(50) | 123 number_games_world_tournamentDecimal(28,7) | 123 number_games_continental_tournamentDecimal(28,7) | 123 percent_victory_world_tournamentDouble | 123 percent_victory_continental_tournamentDouble | 123 percent_victory_homeDouble | 123 percent_victory_awayDouble | 123 percent_victoryDouble | 123 percent_drawDouble | 123 avg_goalsDouble | 123 avg_goals_concededDouble | 123 nb_world_cupBigint | 123 nb_continental_cupDecimal(27,6) | Abc confederationVarchar(8) | 123 word_cup_victoryInteger | 123 fifa_rankInteger | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Brazil | 1.0 | 0.8403614 | 0.6788321167883211 | 0.5770609318996416 | 0.7333333333333333 | 0.59375 | 0.635091496232508 | 0.20021528525296017 | 2.193756727664155 | 0.93756727664155 | 4 | 0.9 | CONMEBOL | 1 | 5 |
| 2 | Slovenia | 0.0437956 | 0.1656627 | 0.16666666666666666 | 0.38181818181818183 | 0.4264705882352941 | 0.2857142857142857 | 0.352112676056338 | 0.2347417840375587 | 1.2394366197183098 | 1.272300469483568 | 0 | 0.0 | UEFA | 0 | 2 |
| 3 | Canada | 0.0437956 | 0.4337349 | 0.0 | 0.3888888888888889 | 0.3387096774193548 | 0.2814814814814815 | 0.3314121037463977 | 0.23919308357348704 | 1.0489913544668588 | 1.3976945244956773 | 0 | 0.1 | CONCACAF | 0 | 3 |
| 4 | Gotland | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.2857142857142857 | 0.34615384615384615 | 0.15384615384615385 | 2.4615384615384617 | 2.0 | 0 | 0.0 | OFC | 0 | 1 |
| 5 | Saint Martin | 0.0 | 0.0 | 0.0 | 0.0 | 0.75 | 0.16 | 0.30303030303030304 | 0.09090909090909091 | 1.121212121212121 | 2.909090909090909 | 0 | 0.0 | OFC | 0 | 1 |
| 6 | Cayman Islands | 0.0 | 0.0421687 | 0.0 | 0.0 | 0.3333333333333333 | 0.13513513513513514 | 0.18518518518518517 | 0.16049382716049382 | 1.037037037037037 | 2.54320987654321 | 0 | 0.0 | OFC | 0 | 0 |
| 7 | Iran | 0.0875912 | 0.5271084 | 0.08333333333333333 | 0.5942857142857143 | 0.6415094339622641 | 0.43037974683544306 | 0.5343680709534369 | 0.2616407982261641 | 1.8403547671840355 | 0.835920177383592 | 0 | 0.3 | AFC | 0 | 4 |
| 8 | Kuwait | 0.0218978 | 0.4006024 | 0.0 | 0.47368421052631576 | 0.4573170731707317 | 0.37916666666666665 | 0.42407407407407405 | 0.2722222222222222 | 1.5555555555555556 | 1.0796296296296297 | 0 | 0.1 | AFC | 0 | 3 |
| 9 | Lithuania | 0.0 | 0.189759 | 0.0 | 0.25396825396825395 | 0.4090909090909091 | 0.24293785310734464 | 0.2896341463414634 | 0.18902439024390244 | 1.0975609756097562 | 1.7835365853658536 | 0 | 0.0 | UEFA | 0 | 2 |
| 10 | Nigeria | 0.1751825 | 0.5481928 | 0.2916666666666667 | 0.5439560439560439 | 0.6203703703703703 | 0.319047619047619 | 0.4580152671755725 | 0.2958015267175573 | 1.4961832061068703 | 1.0038167938931297 | 0 | 0.3 | CAF | 0 | 4 |
| 11 | Cameroon | 0.2262774 | 0.4638554 | 0.25806451612903225 | 0.564935064935065 | 0.5882352941176471 | 0.32057416267942584 | 0.44258872651356995 | 0.30062630480167013 | 1.4217118997912317 | 1.0542797494780793 | 0 | 0.2 | CAF | 0 | 4 |
| 12 | South Korea | 0.2481752 | 0.5783133 | 0.20588235294117646 | 0.5625 | 0.5789473684210527 | 0.5122615803814714 | 0.5286783042394015 | 0.256857855361596 | 1.7830423940149627 | 0.8977556109725686 | 0 | 0.3 | AFC | 0 | 4 |
| 13 | New Zealand | 0.1094891 | 0.2168675 | 0.0 | 0.5416666666666666 | 0.4868421052631579 | 0.3468208092485549 | 0.40476190476190477 | 0.18154761904761904 | 1.7470238095238095 | 1.6130952380952381 | 0 | 0.0 | OFC | 0 | 3 |
| 14 | Iceland | 0.0 | 0.2891566 | 0.0 | 0.21875 | 0.4307692307692308 | 0.23780487804878048 | 0.29743589743589743 | 0.18974358974358974 | 1.1641025641025642 | 1.7 | 0 | 0.0 | UEFA | 0 | 2 |
| 15 | Honduras | 0.0656934 | 0.5271084 | 0.0 | 0.44 | 0.5483870967741935 | 0.3316062176165803 | 0.4085106382978723 | 0.26170212765957446 | 1.4914893617021276 | 1.2234042553191489 | 0 | 0.0 | CONMEBOL | 0 | 3 |
| 16 | Ecuador | 0.0729927 | 0.7349398 | 0.4 | 0.2459016393442623 | 0.59375 | 0.24025974025974026 | 0.2944915254237288 | 0.2457627118644068 | 1.194915254237288 | 1.6504237288135593 | 0 | 0.2 | CONMEBOL | 0 | 4 |
| 17 | Isle of Man | 0.0 | 0.0 | 0.0 | 0.0 | 0.25 | 0.5555555555555556 | 0.525 | 0.1 | 2.8 | 1.625 | 0 | 0.0 | OFC | 0 | 0 |
| 18 | Saint Lucia | 0.0 | 0.0662651 | 0.0 | 0.2727272727272727 | 0.40350877192982454 | 0.308411214953271 | 0.3333333333333333 | 0.13978494623655913 | 1.4731182795698925 | 1.9623655913978495 | 0 | 0.0 | OFC | 0 | 2 |
| 19 | Catalonia | 0.0 | 0.0 | 0.0 | 0.0 | 0.4594594594594595 | 0.1111111111111111 | 0.391304347826087 | 0.2391304347826087 | 1.5217391304347827 | 1.7391304347826086 | 0 | 0.0 | OFC | 0 | 1 |
| 20 | Sudan | 0.0 | 0.2620482 | 0.0 | 0.25287356321839083 | 0.5921052631578947 | 0.2783018867924528 | 0.336 | 0.248 | 1.1413333333333333 | 1.368 | 0 | 0.0 | CAF | 0 | 2 |
Let’s look at the strongest group, which includes well-known teams like Argentina, Brazil, and France.
teams_kpi.search(
conditions = [teams_kpi["fifa_rank"] == 5],
usecols = ["team1", "fifa_rank"],
order_by = ["fifa_rank"],
).head(10)
Abc team1Varchar(50) | 123 fifa_rankInteger | |
|---|---|---|
| 1 | Uruguay | 5 |
| 2 | Sweden | 5 |
| 3 | Italy | 5 |
| 4 | Argentina | 5 |
| 5 | Germany | 5 |
| 6 | England | 5 |
| 7 | Brazil | 5 |
| 8 | Spain | 5 |
| 9 | France | 5 |
The weakest group includes less well-known teams.
teams_kpi.search(
conditions = [teams_kpi["fifa_rank"] == 0],
usecols = ["team1", "fifa_rank"],
order_by = ["fifa_rank"],
).head(10)
Abc team1Varchar(50) | 123 fifa_rankInteger | |
|---|---|---|
| 1 | Western Australia | 0 |
| 2 | Andorra | 0 |
| 3 | Provence | 0 |
| 4 | Anguilla | 0 |
| 5 | Ynys Môn | 0 |
| 6 | Faroe Islands | 0 |
| 7 | Malta | 0 |
| 8 | Kernow | 0 |
| 9 | Western Isles | 0 |
| 10 | Northern Mariana Islands | 0 |
A bubble plot will let us visualize the differences in strength between each confederation.
We can see the strongest group at the top right of the graphic and weakest teams at the bottom left. Some teams may be very good in their location but very bad in World Tournaments. They are mainly at the bottom right of the graph.
teams_kpi.scatter(
[
"Percent_Victory_Continental_Tournament",
"Percent_Victory_World_Tournament",
],
size = "fifa_rank",
by = "confederation",
)
We can also look at the Percent of Victory by rank to confirm our hypothesis.
teams_kpi.scatter(
[
"Percent_Victory_Continental_Tournament",
"Percent_Victory_World_Tournament",
],
size = "Percent_Victory",
by = "fifa_rank",
)
A box plot can also show us the differences in skill between teams. We can look at rank 1, where the percent of victory is high because of the confederation.
Note that the best team in a weaker confederation might not be particularly strong, but still have a high Percent of Victory.
teams_kpi["Percent_Victory"].boxplot(by = "fifa_rank")
Let’s export the KPIs to our VAST DataBase.
vo.drop(
"team_kpi",
method = "table",
)
teams_kpi.to_db(
name = "team_kpi",
relation_type = "table",
inplace = True,
)
Abc team1Varchar(50) | 123 number_games_world_tournamentDecimal(28,7) | 123 number_games_continental_tournamentDecimal(28,7) | 123 percent_victory_world_tournamentDouble | 123 percent_victory_continental_tournamentDouble | 123 percent_victory_homeDouble | 123 percent_victory_awayDouble | 123 percent_victoryDouble | 123 percent_drawDouble | 123 avg_goalsDouble | 123 avg_goals_concededDouble | 123 nb_world_cupBigint | 123 nb_continental_cupDecimal(27,6) | Abc confederationVarchar(8) | 123 word_cup_victoryInteger | 123 fifa_rankInteger | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Israel | 0.0218978 | 0.373494 | 0.0 | 0.3548387096774194 | 0.38926174496644295 | 0.30327868852459017 | 0.3492462311557789 | 0.25125628140703515 | 1.4547738693467336 | 1.4522613065326633 | 0 | 0.1 | UEFA | 0 | 3 |
| 2 | Colombia | 0.1678832 | 0.7801205 | 0.391304347826087 | 0.3667953667953668 | 0.46875 | 0.35714285714285715 | 0.378 | 0.272 | 1.206 | 1.21 | 0 | 0.1 | CONMEBOL | 0 | 4 |
| 3 | Vietnam Republic | 0.0 | 0.0271084 | 0.0 | 0.1111111111111111 | 0.6153846153846154 | 0.3904761904761905 | 0.43137254901960786 | 0.17647058823529413 | 1.8366013071895424 | 1.7320261437908497 | 0 | 0.0 | AFC | 0 | 1 |
| 4 | Saare County | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.12903225806451613 | 0.12903225806451613 | 0.0967741935483871 | 1.032258064516129 | 2.6129032258064515 | 0 | 0.0 | OFC | 0 | 0 |
| 5 | Greenland | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.3125 | 0.30303030303030304 | 0.10606060606060606 | 1.7424242424242424 | 2.090909090909091 | 0 | 0.0 | OFC | 0 | 0 |
| 6 | Orkney | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.15384615384615385 | 0.15384615384615385 | 0.0 | 1.0 | 4.3076923076923075 | 0 | 0.0 | OFC | 0 | 0 |
| 7 | Kyrgyzstan | 0.0 | 0.0903614 | 0.0 | 0.36666666666666664 | 0.4444444444444444 | 0.15942028985507245 | 0.24074074074074073 | 0.1574074074074074 | 0.9166666666666666 | 1.8611111111111112 | 0 | 0.0 | AFC | 0 | 2 |
| 8 | Papua New Guinea | 0.0 | 0.0301205 | 0.0 | 0.4 | 0.3333333333333333 | 0.24 | 0.26804123711340205 | 0.17525773195876287 | 1.907216494845361 | 2.2268041237113403 | 0 | 0.0 | OFC | 0 | 2 |
| 9 | Tunisia | 0.1094891 | 0.4849398 | 0.13333333333333333 | 0.4472049689440994 | 0.531578947368421 | 0.2777777777777778 | 0.4166666666666667 | 0.2916666666666667 | 1.433712121212121 | 1.0643939393939394 | 0 | 0.1 | CAF | 0 | 3 |
| 10 | San Marino | 0.0 | 0.1686747 | 0.0 | 0.0 | 0.024390243902439025 | 0.0 | 0.007462686567164179 | 0.029850746268656716 | 0.15671641791044777 | 4.268656716417911 | 0 | 0.0 | UEFA | 0 | 0 |
| 11 | Benin | 0.0 | 0.1506024 | 0.0 | 0.24 | 0.27631578947368424 | 0.13725490196078433 | 0.20614035087719298 | 0.22807017543859648 | 1.0043859649122806 | 1.9517543859649122 | 0 | 0.0 | CAF | 0 | 2 |
| 12 | Eswatini | 0.0 | 0.0572289 | 0.0 | 0.21052631578947367 | 0.24096385542168675 | 0.17708333333333334 | 0.20707070707070707 | 0.2727272727272727 | 0.8282828282828283 | 1.7424242424242424 | 0 | 0.0 | CAF | 0 | 0 |
| 13 | Mauritius | 0.0 | 0.063253 | 0.0 | 0.047619047619047616 | 0.35294117647058826 | 0.2903225806451613 | 0.2863849765258216 | 0.2112676056338028 | 1.3286384976525822 | 1.699530516431925 | 0 | 0.0 | CAF | 0 | 1 |
| 14 | Seychelles | 0.0 | 0.0421687 | 0.0 | 0.0 | 0.4166666666666667 | 0.0425531914893617 | 0.1411764705882353 | 0.1411764705882353 | 0.7294117647058823 | 2.0588235294117645 | 0 | 0.0 | CAF | 0 | 1 |
| 15 | Basque Country | 0.0 | 0.0 | 0.0 | 0.0 | 0.6333333333333333 | 0.6956521739130435 | 0.660377358490566 | 0.16981132075471697 | 2.7547169811320753 | 1.3396226415094339 | 0 | 0.0 | OFC | 0 | 1 |
| 16 | Székely Land | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 3.0 | 0 | 0.0 | OFC | 0 | 0 |
| 17 | Chinese Taipei | 0.0 | 0.1054217 | 0.0 | 0.11428571428571428 | 0.5 | 0.25316455696202533 | 0.21551724137931033 | 0.15517241379310345 | 1.3189655172413792 | 2.853448275862069 | 0 | 0.0 | AFC | 0 | 1 |
| 18 | South Korea | 0.2481752 | 0.5783133 | 0.20588235294117646 | 0.5625 | 0.5789473684210527 | 0.5122615803814714 | 0.5286783042394015 | 0.256857855361596 | 1.7830423940149627 | 0.8977556109725686 | 0 | 0.3 | AFC | 0 | 4 |
| 19 | New Zealand | 0.1094891 | 0.2168675 | 0.0 | 0.5416666666666666 | 0.4868421052631579 | 0.3468208092485549 | 0.40476190476190477 | 0.18154761904761904 | 1.7470238095238095 | 1.6130952380952381 | 0 | 0.0 | OFC | 0 | 3 |
| 20 | Iceland | 0.0 | 0.2891566 | 0.0 | 0.21875 | 0.4307692307692308 | 0.23780487804878048 | 0.29743589743589743 | 0.18974358974358974 | 1.1641025641025642 | 1.7 | 0 | 0.0 | UEFA | 0 | 2 |
Features Engineering¶
Many very interesting features can be to use to evaluate each team. Moving windows of the previous games can drastically improve our model.
Since a team can by a home or away team, we’ll intervert the away and home teams. By using this technique, we will never get twice the same game and we will get the proper moving windows.
football = vo.VastFrame("football_clean")
football["home_team"].rename("team1");
football["home_score"].rename("team1_score");
football["away_team"].rename("team2");
football["away_score"].rename("team2_score");
# will be to use to filter the data after the features engineering
football["match_sample"] = "1";
football2 = vo.VastFrame("football_clean");
football2["home_team"].rename("team2");
football2["home_score"].rename("team2_score");
football2["away_team"].rename("team1");
football2["away_score"].rename("team1_score");
# will be to use to filter the data after the features engineering
football2["match_sample"] = "2";
# Merging the 2 interverted datasets
all_matchs = football.append(football2);
Let’s add the different KPIs to our dataset.
all_matchs = all_matchs.join(
teams_kpi,
on = {"team1": "team1"},
how = "left",
expr2 = [
"nb_World_Cup AS nb_World_Cup_1",
"fifa_rank AS fifa_rank_1",
"Avg_goals AS Avg_goals_1",
"Percent_Draw AS Percent_Draw_1",
"Number_Games_World_Tournament AS Number_Games_World_Tournament_1",
"Percent_Victory_World_Tournament AS Percent_Victory_World_Tournament_1",
"Percent_Victory_Away AS Percent_Victory_Away_1",
"Percent_Victory_Continental_Tournament AS Percent_Victory_Continental_Tournament_1",
"confederation AS confederation_1",
"Percent_Victory_Home AS Percent_Victory_Home_1",
"Avg_goals_conceded AS Avg_goals_conceded_1",
"Number_Games_Continental_Tournament AS Number_Games_Continental_Tournament_1",
"nb_Continental_Cup AS nb_Continental_Cup_1",
"Percent_Victory AS Percent_Victory_1",
],
)
all_matchs = all_matchs.join(
teams_kpi,
on = {"team2": "team1"},
how = "left",
expr2 = [
"nb_World_Cup AS nb_World_Cup_2",
"fifa_rank AS fifa_rank_2",
"Avg_goals AS Avg_goals_2",
"Percent_Draw AS Percent_Draw_2",
"Number_Games_World_Tournament AS Number_Games_World_Tournament_2",
"Percent_Victory_World_Tournament AS Percent_Victory_World_Tournament_2",
"Percent_Victory_Away AS Percent_Victory_Away_2",
"Percent_Victory_Continental_Tournament AS Percent_Victory_Continental_Tournament_2",
"confederation AS confederation_2",
"Percent_Victory_Home AS Percent_Victory_Home_2",
"Avg_goals_conceded AS Avg_goals_conceded_2",
"Number_Games_Continental_Tournament AS Number_Games_Continental_Tournament_2",
"nb_Continental_Cup AS nb_Continental_Cup_2",
"Percent_Victory AS Percent_Victory_2",
],
)
We can add dumies to do aggregations on the different games.
all_matchs["victory_team1"] = all_matchs["team1_score"] > all_matchs["team2_score"]
all_matchs["victory_team1"].astype("int")
all_matchs["draw"] = all_matchs["team1_score"] == all_matchs["team2_score"]
all_matchs["draw"].astype("int")
all_matchs["victory_team2"] = all_matchs["team1_score"] < all_matchs["team2_score"]
all_matchs["victory_team2"].astype("int")
📅 dateDate | Abc tournamentVarchar(50) | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | 123 fifa_rank_2Integer | 123 Avg_goals_2Double | 123 Percent_Draw_2Double | 123 Number_Games_World_Tournament_2Decimal(28,7) | 123 Percent_Victory_World_Tournament_2Double | 123 Percent_Victory_Away_2Double | 123 Percent_Victory_Continental_Tournament_2Double | Abc confederation_2Varchar(8) | 123 Percent_Victory_Home_2Double | 123 Avg_goals_conceded_2Double | 123 Number_Games_Continental_Tournament_2Decimal(28,7) | 123 nb_Continental_Cup_2Decimal(27,6) | 123 Percent_Victory_2Double | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1993-12-16 | Friendly | ✗ | Mexico | Guadalajara | Mexico | 0 | Brazil | 1 | 1 | 0 | 4 | 1.7475 | 0.2375 | 0.5474453 | 0.30666666666666664 | 0.42356687898089174 | 0.6085271317829457 | CONMEBOL | 0.5424836601307189 | 1.07625 | 0.7771084 | 0.5 | 0.495 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 2 | 2009-06-21 | Confederations Cup | ✓ | South Africa | Pretoria | Italy | 0 | Brazil | 3 | 1 | 3 | 5 | 1.6958831341301461 | 0.28286852589641437 | 0.6642336 | 0.5274725274725275 | 0.3464566929133858 | 0.6153846153846154 | UEFA | 0.6438848920863309 | 0.9827357237715804 | 0.3915663 | 0.1 | 0.5245683930942895 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 3 | 2011-11-10 | Friendly | ✗ | Gabon | Libreville | Gabon | 0 | Brazil | 2 | 1 | 0 | 2 | 1.1926605504587156 | 0.2782874617737003 | 0.0 | 0.0 | 0.2702702702702703 | 0.37681159420289856 | CAF | 0.4727272727272727 | 1.1314984709480123 | 0.2078313 | 0.0 | 0.36085626911314983 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 4 | 2017-10-05 | FIFA World Cup qualification | ✗ | Bolivia | La Paz | Bolivia | 0 | Brazil | 0 | 1 | 0 | 3 | 1.0381861575178997 | 0.24821002386634844 | 0.0656934 | 0.0 | 0.13861386138613863 | 0.2222222222222222 | CONMEBOL | 0.3787878787878788 | 1.9427207637231503 | 0.7319277 | 0.0 | 0.22195704057279236 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 1 | 0 |
| 5 | 1979-08-23 | Copa América | ✗ | Argentina | Buenos Aires | Argentina | 2 | Brazil | 2 | 1 | 2 | 5 | 1.8654467168998923 | 0.24865446716899892 | 0.6350365 | 0.5402298850574713 | 0.40606060606060607 | 0.6059602649006622 | CONMEBOL | 0.638095238095238 | 1.0505920344456405 | 0.9096386 | 0.8 | 0.5360602798708288 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 1 | 0 |
| 6 | 2005-10-09 | FIFA World Cup qualification | ✗ | Bolivia | La Paz | Bolivia | 1 | Brazil | 1 | 1 | 0 | 3 | 1.0381861575178997 | 0.24821002386634844 | 0.0656934 | 0.0 | 0.13861386138613863 | 0.2222222222222222 | CONMEBOL | 0.3787878787878788 | 1.9427207637231503 | 0.7319277 | 0.0 | 0.22195704057279236 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 1 | 0 |
| 7 | 1959-03-21 | Copa América | ✓ | Argentina | Buenos Aires | Bolivia | 2 | Brazil | 4 | 1 | 0 | 3 | 1.0381861575178997 | 0.24821002386634844 | 0.0656934 | 0.0 | 0.13861386138613863 | 0.2222222222222222 | CONMEBOL | 0.3787878787878788 | 1.9427207637231503 | 0.7319277 | 0.0 | 0.22195704057279236 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 8 | 1988-07-17 | Friendly | ✗ | Australia | Sydney | Australia | 0 | Brazil | 2 | 1 | 0 | 4 | 2.031712473572939 | 0.21141649048625794 | 0.189781 | 0.2692307692307692 | 0.5112359550561798 | 0.583941605839416 | AFC | 0.4393939393939394 | 1.1120507399577166 | 0.4126506 | 0.1 | 0.4989429175475687 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 9 | 1997-12-14 | Confederations Cup | ✓ | Saudi Arabia | Riyadh | Australia | 0 | Brazil | 0 | 1 | 0 | 4 | 2.031712473572939 | 0.21141649048625794 | 0.189781 | 0.2692307692307692 | 0.5112359550561798 | 0.583941605839416 | AFC | 0.4393939393939394 | 1.1120507399577166 | 0.4126506 | 0.1 | 0.4989429175475687 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 1 | 0 |
| 10 | 2017-06-13 | Friendly | ✗ | Australia | Melbourne | Australia | 0 | Brazil | 4 | 1 | 0 | 4 | 2.031712473572939 | 0.21141649048625794 | 0.189781 | 0.2692307692307692 | 0.5112359550561798 | 0.583941605839416 | AFC | 0.4393939393939394 | 1.1120507399577166 | 0.4126506 | 0.1 | 0.4989429175475687 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 11 | 1987-07-03 | Copa América | ✓ | Argentina | Córdoba | Chile | 4 | Brazil | 0 | 1 | 0 | 4 | 1.4214992927864214 | 0.2065063649222065 | 0.2408759 | 0.3333333333333333 | 0.2571428571428571 | 0.3754152823920266 | CONMEBOL | 0.558282208588957 | 1.4653465346534653 | 0.9066265 | 0.2 | 0.38048090523338046 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 1 | 0 | 0 |
| 12 | 1988-07-07 | Friendly | ✗ | Australia | Melbourne | Australia | 0 | Brazil | 1 | 1 | 0 | 4 | 2.031712473572939 | 0.21141649048625794 | 0.189781 | 0.2692307692307692 | 0.5112359550561798 | 0.583941605839416 | AFC | 0.4393939393939394 | 1.1120507399577166 | 0.4126506 | 0.1 | 0.4989429175475687 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 13 | 1985-05-21 | Friendly | ✗ | Chile | Santiago | Chile | 2 | Brazil | 1 | 1 | 0 | 4 | 1.4214992927864214 | 0.2065063649222065 | 0.2408759 | 0.3333333333333333 | 0.2571428571428571 | 0.3754152823920266 | CONMEBOL | 0.558282208588957 | 1.4653465346534653 | 0.9066265 | 0.2 | 0.38048090523338046 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 1 | 0 | 0 |
| 14 | 1957-09-15 | Copa Bernardo O'Higgins | ✗ | Chile | Santiago | Chile | 1 | Brazil | 0 | 1 | 0 | 4 | 1.4214992927864214 | 0.2065063649222065 | 0.2408759 | 0.3333333333333333 | 0.2571428571428571 | 0.3754152823920266 | CONMEBOL | 0.558282208588957 | 1.4653465346534653 | 0.9066265 | 0.2 | 0.38048090523338046 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 1 | 0 | 0 |
| 15 | 2001-06-09 | Confederations Cup | ✓ | South Korea | Ulsan | Australia | 1 | Brazil | 0 | 1 | 0 | 4 | 2.031712473572939 | 0.21141649048625794 | 0.189781 | 0.2692307692307692 | 0.5112359550561798 | 0.583941605839416 | AFC | 0.4393939393939394 | 1.1120507399577166 | 0.4126506 | 0.1 | 0.4989429175475687 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 1 | 0 | 0 |
| 16 | 1957-09-18 | Copa Bernardo O'Higgins | ✗ | Chile | Santiago | Chile | 1 | Brazil | 1 | 1 | 0 | 4 | 1.4214992927864214 | 0.2065063649222065 | 0.2408759 | 0.3333333333333333 | 0.2571428571428571 | 0.3754152823920266 | CONMEBOL | 0.558282208588957 | 1.4653465346534653 | 0.9066265 | 0.2 | 0.38048090523338046 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 1 | 0 |
| 17 | 1999-07-14 | Copa América | ✓ | Paraguay | Ciudad del Este | Mexico | 0 | Brazil | 2 | 1 | 0 | 4 | 1.7475 | 0.2375 | 0.5474453 | 0.30666666666666664 | 0.42356687898089174 | 0.6085271317829457 | CONMEBOL | 0.5424836601307189 | 1.07625 | 0.7771084 | 0.5 | 0.495 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 18 | 2000-08-15 | FIFA World Cup qualification | ✗ | Chile | Santiago | Chile | 3 | Brazil | 0 | 1 | 0 | 4 | 1.4214992927864214 | 0.2065063649222065 | 0.2408759 | 0.3333333333333333 | 0.2571428571428571 | 0.3754152823920266 | CONMEBOL | 0.558282208588957 | 1.4653465346534653 | 0.9066265 | 0.2 | 0.38048090523338046 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 1 | 0 | 0 |
| 19 | 2013-10-12 | Friendly | ✗ | South Korea | Seoul | South Korea | 0 | Brazil | 2 | 1 | 0 | 4 | 1.7830423940149627 | 0.256857855361596 | 0.2481752 | 0.20588235294117646 | 0.5122615803814714 | 0.5625 | AFC | 0.5789473684210527 | 0.8977556109725686 | 0.5783133 | 0.3 | 0.5286783042394015 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 0 | 1 |
| 20 | 2006-08-16 | Friendly | ✗ | Norway | Oslo | Norway | 1 | Brazil | 1 | 1 | 0 | 3 | 1.5013089005235603 | 0.22774869109947643 | 0.0583942 | 0.25 | 0.3343465045592705 | 0.3474576271186441 | UEFA | 0.3948220064724919 | 1.6845549738219896 | 0.3554217 | 0.0 | 0.3599476439790576 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | 1 | 0 |
Let’s use moving windows to compute some additional features.
The teams’ performance in their recent games¶
# TEAM 1
# Victory 10 previous games
all_matchs.rolling(
func = "avg",
window = (-10, -1),
columns = "victory_team1",
by = ["team1"],
order_by = ["date"],
name = "avg_victory_team1_1_10",
)
# Victory 3 previous games
all_matchs.rolling(
func = "avg",
window = (-3, -1),
columns = "victory_team1",
by = ["team1"],
order_by = ["date"],
name = "avg_victory_team1_1_3",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team1"],
order_by = ["date"],
name = "avg_draw_team1_1_5",
)
# TEAM 2
# Victory 10 previous games
all_matchs.rolling(
func = "avg",
window = (-10, -1),
columns = "victory_team2",
by = ["team2"],
order_by = ["date"],
name = "avg_victory_team2_1_10",
)
# Victory 3 previous games
all_matchs.rolling(
func = "avg",
window = (-3, -1),
columns = "victory_team2",
by = ["team2"],
order_by = ["date"],
name = "avg_victory_team2_1_3",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team2"],
order_by = ["date"],
name = "avg_draw_team2_1_5",
)
📅 dateDate | Abc tournamentVarchar(50) | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | 123 fifa_rank_2Integer | 123 Avg_goals_2Double | 123 Percent_Draw_2Double | 123 Number_Games_World_Tournament_2Decimal(28,7) | 123 Percent_Victory_World_Tournament_2Double | 123 Percent_Victory_Away_2Double | 123 Percent_Victory_Continental_Tournament_2Double | Abc confederation_2Varchar(8) | 123 Percent_Victory_Home_2Double | 123 Avg_goals_conceded_2Double | 123 Number_Games_Continental_Tournament_2Decimal(28,7) | 123 nb_Continental_Cup_2Decimal(27,6) | 123 Percent_Victory_2Double | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2012-10-21 | Friendly | ✗ | Azerbaijan | Stepanakert | Artsakh | 3 | Abkhazia | 0 | 1 | 0 | 1 | 3.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 1 | 0 | 0 | [null] | [null] | [null] | [null] | [null] | [null] |
| 2 | 2014-06-01 | CONIFA World Football Cup | ✓ | Sweden | Östersund | Occitania | 1 | Abkhazia | 1 | 2 | 0 | 0 | 1.25 | 0.16666666666666666 | 0.0 | 0.0 | 0.3 | 0.0 | OFC | 0.0 | 1.8333333333333333 | 0.0 | 0.0 | 0.25 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 0.125 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 |
| 3 | 2014-06-02 | CONIFA World Football Cup | ✗ | Sweden | Östersund | Sápmi | 1 | Abkhazia | 2 | 1 | 0 | 1 | 4.357142857142857 | 0.14285714285714285 | 0.0 | 0.0 | 0.5 | 0.0 | OFC | 0.375 | 1.7142857142857142 | 0.0 | 0.0 | 0.42857142857142855 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.4 | 0.0 | 0.2 | 0.0 | 0.0 | 0.5 |
| 4 | 2014-06-04 | CONIFA World Football Cup | ✓ | Sweden | Östersund | South Ossetia | 0 | Abkhazia | 0 | 2 | 0 | 0 | 0.6666666666666666 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 0.0 | 2.3333333333333335 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 0.0 | 0.0 | 0.0 | 0.3333333333333333 | 0.3333333333333333 | 0.3333333333333333 |
| 5 | 2014-06-05 | CONIFA World Football Cup | ✓ | Sweden | Östersund | Padania | 3 | Abkhazia | 3 | 1 | 0 | 1 | 2.5 | 0.125 | 0.0 | 0.0 | 0.8333333333333334 | 0.0 | OFC | 1.0 | 0.5625 | 0.0 | 0.0 | 0.875 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 1.0 | 1.0 | 0.0 | 0.25 | 0.3333333333333333 | 0.5 |
| 6 | 2014-06-07 | CONIFA World Football Cup | ✓ | Sweden | Östersund | Occitania | 1 | Abkhazia | 0 | 2 | 0 | 0 | 1.25 | 0.16666666666666666 | 0.0 | 0.0 | 0.3 | 0.0 | OFC | 0.0 | 1.8333333333333333 | 0.0 | 0.0 | 0.25 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 1 | 0 | 0 | 0.2 | 0.3333333333333333 | 0.4 | 0.2 | 0.3333333333333333 | 0.6 |
| 7 | 2016-05-29 | CONIFA World Football Cup | ✗ | Georgia | Suhkumi | Chagos Islands | 0 | Abkhazia | 9 | 2 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | [null] | [null] | [null] | 0.16666666666666666 | 0.0 | 0.6 |
| 8 | 2016-05-31 | CONIFA World Football Cup | ✗ | Georgia | Suhkumi | Western Armenia | 0 | Abkhazia | 1 | 2 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | [null] | [null] | [null] | 0.2857142857142857 | 0.3333333333333333 | 0.4 |
| 9 | 2016-06-01 | CONIFA World Football Cup | ✗ | Georgia | Suhkumi | Sápmi | 0 | Abkhazia | 2 | 2 | 0 | 1 | 4.357142857142857 | 0.14285714285714285 | 0.0 | 0.0 | 0.5 | 0.0 | OFC | 0.375 | 1.7142857142857142 | 0.0 | 0.0 | 0.42857142857142855 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.3 | 0.3333333333333333 | 0.2 | 0.375 | 0.6666666666666666 | 0.4 |
| 10 | 2016-06-04 | CONIFA World Football Cup | ✗ | Georgia | Suhkumi | Northern Cyprus | 0 | Abkhazia | 2 | 2 | 0 | 1 | 2.2666666666666666 | 0.06666666666666667 | 0.0 | 0.0 | 0.4 | 0.0 | OFC | 0.8 | 1.2 | 0.0 | 0.0 | 0.5333333333333333 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.6 | 0.6666666666666666 | 0.2 | 0.4444444444444444 | 1.0 | 0.2 |
| 11 | 2016-06-05 | CONIFA World Football Cup | ✗ | Georgia | Suhkumi | Panjab | 1 | Abkhazia | 1 | 2 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 0.5 | 0.5 | 0.0 | 0.5 | 1.0 | 0.0 |
| 12 | 2017-06-05 | CONIFA European Football Cup | ✓ | Northern Cyprus | Kyrenia | South Ossetia | 1 | Abkhazia | 2 | 2 | 0 | 0 | 0.6666666666666666 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 0.0 | 2.3333333333333335 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.0 | 0.0 | 0.3333333333333333 | 0.5 | 0.6666666666666666 | 0.2 |
| 13 | 2017-06-07 | CONIFA European Football Cup | ✗ | Northern Cyprus | Morphou | Northern Cyprus | 0 | Abkhazia | 0 | 1 | 0 | 1 | 2.2666666666666666 | 0.06666666666666667 | 0.0 | 0.0 | 0.4 | 0.0 | OFC | 0.8 | 1.2 | 0.0 | 0.0 | 0.5333333333333333 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 0.5 | 0.6666666666666666 | 0.2 | 0.6 | 0.6666666666666666 | 0.2 |
| 14 | 2017-06-09 | CONIFA European Football Cup | ✓ | Northern Cyprus | Kyrenia | Padania | 0 | Abkhazia | 0 | 1 | 0 | 1 | 2.5 | 0.125 | 0.0 | 0.0 | 0.8333333333333334 | 0.0 | OFC | 1.0 | 0.5625 | 0.0 | 0.0 | 0.875 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 0.5 | 0.6666666666666666 | 0.2 | 0.5 | 0.3333333333333333 | 0.4 |
| 15 | 2017-06-10 | CONIFA European Football Cup | ✓ | Northern Cyprus | Kyrenia | Székely Land | 3 | Abkhazia | 1 | 1 | 0 | 0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 0.0 | 3.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 1 | 0 | 0 | 0.2857142857142857 | 0.3333333333333333 | 0.2 | 0.5 | 0.3333333333333333 | 0.6 |
| 16 | 2018-05-31 | CONIFA World Football Cup | ✓ | England | Enfield | Tibet | 0 | Abkhazia | 3 | 2 | 0 | 0 | 0.25 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 0.0 | 5.5 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.0 | 0.0 | 0.0 | 0.5 | 0.0 | 0.6 |
| 17 | 2018-06-03 | CONIFA World Football Cup | ✓ | England | Enfield | Northern Cyprus | 2 | Abkhazia | 2 | 2 | 0 | 1 | 2.2666666666666666 | 0.06666666666666667 | 0.0 | 0.0 | 0.4 | 0.0 | OFC | 0.8 | 1.2 | 0.0 | 0.0 | 0.5333333333333333 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 0.6 | 0.6666666666666666 | 0.4 | 0.6 | 0.3333333333333333 | 0.4 |
| 18 | 2018-06-05 | CONIFA World Football Cup | ✓ | England | Aveley | Tamil Eelam | 0 | Abkhazia | 6 | 2 | 0 | 0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 4.166666666666667 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.2222222222222222 | 0.3333333333333333 | 0.0 | 0.5 | 0.3333333333333333 | 0.6 |
| 19 | 2019-06-03 | CONIFA European Football Cup | ✓ | Azerbaijan | Martakert | Sápmi | 0 | Abkhazia | 1 | 1 | 0 | 1 | 4.357142857142857 | 0.14285714285714285 | 0.0 | 0.0 | 0.5 | 0.0 | OFC | 0.375 | 1.7142857142857142 | 0.0 | 0.0 | 0.42857142857142855 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 0 | 1 | 0.3 | 0.6666666666666666 | 0.0 | 0.5 | 0.6666666666666666 | 0.4 |
| 20 | 2019-06-04 | CONIFA European Football Cup | ✗ | Azerbaijan | Martuni | Artsakh | 1 | Abkhazia | 1 | 1 | 0 | 1 | 3.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | 1 | 0 | 1.0 | 1.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.2 |
The teams’ performance in the last same tournament¶
# TEAM 1
# Victory 10 previous games
all_matchs.rolling(
func = "avg",
window = (-10, -1),
columns = "victory_team1",
by = ["team1", "tournament"],
order_by = ["date"],
name = "avg_victory_same_tournament_team1_1_10",
)
# Victory 3 previous games
all_matchs.rolling(
func = "avg",
window = (-3, -1),
columns = "victory_team1",
by = ["team1", "tournament"],
order_by = ["date"],
name = "avg_victory_same_tournament_team1_1_3",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team1", "tournament"],
order_by = ["date"],
name = "avg_draw_same_tournament_team1_1_5",
)
# TEAM 2
# Victory 10 previous games
all_matchs.rolling(
func = "avg",
window = (-10, -1),
columns = "victory_team2",
by = ["team2", "tournament"],
order_by = ["date"],
name = "avg_victory_same_tournament_team2_1_10",
)
# Victory 3 previous games
all_matchs.rolling(
func = "avg",
window = (-3, -1),
columns = "victory_team2",
by = ["team2", "tournament"],
order_by = ["date"],
name = "avg_victory_same_tournament_team2_1_3",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team2", "tournament"],
order_by = ["date"],
name = "avg_draw_same_tournament_team2_1_5",
)
📅 dateDate | Abc tournamentVarchar(50) | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 Number_Games_World_Tournament_2Decimal(28,7) | 123 Percent_Victory_World_Tournament_2Double | 123 Percent_Victory_Away_2Double | 123 Percent_Victory_Continental_Tournament_2Double | Abc confederation_2Varchar(8) | 123 Percent_Victory_Home_2Double | 123 Avg_goals_conceded_2Double | 123 Number_Games_Continental_Tournament_2Decimal(28,7) | 123 nb_Continental_Cup_2Decimal(27,6) | 123 Percent_Victory_2Double | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Double | 123 avg_victory_same_tournament_team1_1_3Double | 123 avg_draw_same_tournament_team1_1_5Double | 123 avg_victory_same_tournament_team2_1_10Double | 123 avg_victory_same_tournament_team2_1_3Double | 123 avg_draw_same_tournament_team2_1_5Double | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1963-06-29 | UEFA Euro qualification | ✗ | Denmark | Copenhagen | Denmark | 4 | Albania | 0 | 1 | 0 | 4 | 1.77762982689747 | 0.20372836218375498 | 0.1386861 | 0.5263157894736842 | 0.3466666666666667 | 0.4233576642335766 | UEFA | 0.5525423728813559 | 1.4287616511318242 | 0.4126506 | 0.1 | 0.44607190412782954 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.6 | 0.0 | 0.4 | 0.3 | 0.3333333333333333 | 0.2 | 0.5 | 0.6666666666666666 | 0.25 | [null] | [null] | [null] |
| 2 | 1963-10-30 | UEFA Euro qualification | ✗ | Albania | Tirana | Denmark | 0 | Albania | 1 | 2 | 0 | 4 | 1.77762982689747 | 0.20372836218375498 | 0.1386861 | 0.5263157894736842 | 0.3466666666666667 | 0.4233576642335766 | UEFA | 0.5525423728813559 | 1.4287616511318242 | 0.4126506 | 0.1 | 0.44607190412782954 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 0 | 0 | 1 | 0.5 | 0.6666666666666666 | 0.4 | 0.3 | 0.0 | 0.2 | 0.6 | 1.0 | 0.2 | 0.0 | 0.0 | 0.0 |
| 3 | 1967-04-08 | UEFA Euro qualification | ✗ | Germany | Dortmund | Germany | 6 | Albania | 0 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.7 | 1.0 | 0.2 | 0.1 | 0.0 | 0.2 | 0.2857142857142857 | 0.3333333333333333 | 0.4 | 0.5 | 0.5 | 0.0 |
| 4 | 1967-05-14 | UEFA Euro qualification | ✗ | Albania | Tirana | Serbia | 2 | Albania | 0 | 2 | 0 | 4 | 1.8160112359550562 | 0.21910112359550563 | 0.3138686 | 0.3953488372093023 | 0.3815028901734104 | 0.5454545454545454 | UEFA | 0.5445026178010471 | 1.3792134831460674 | 0.3975904 | 0.0 | 0.45646067415730335 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.4 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.2 | 0.5555555555555556 | 0.3333333333333333 | 0.2 | 0.3333333333333333 | 0.3333333333333333 | 0.0 |
| 5 | 1967-11-12 | UEFA Euro qualification | ✗ | Yugoslavia | Belgrade | Serbia | 4 | Albania | 0 | 1 | 0 | 4 | 1.8160112359550562 | 0.21910112359550563 | 0.3138686 | 0.3953488372093023 | 0.3815028901734104 | 0.5454545454545454 | UEFA | 0.5445026178010471 | 1.3792134831460674 | 0.3975904 | 0.0 | 0.45646067415730335 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.2 | 0.25 | 0.3333333333333333 | 0.0 |
| 6 | 1967-12-17 | UEFA Euro qualification | ✗ | Albania | Tirana | Germany | 0 | Albania | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 0 | 1 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.2 | 0.5 | 1.0 | 0.0 | 0.2 | 0.0 | 0.0 |
| 7 | 1970-10-14 | UEFA Euro qualification | ✗ | Poland | Chorzów | Poland | 3 | Albania | 0 | 1 | 0 | 4 | 1.6844155844155844 | 0.2519480519480519 | 0.2262774 | 0.4838709677419355 | 0.352112676056338 | 0.4642857142857143 | UEFA | 0.5 | 1.37012987012987 | 0.3373494 | 0.0 | 0.42597402597402595 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.4 | 0.3 | 0.6666666666666666 | 0.2 | 0.16666666666666666 | 0.0 | 0.2 |
| 8 | 1970-12-13 | UEFA Euro qualification | ✗ | Turkey | Istanbul | Turkey | 2 | Albania | 1 | 1 | 0 | 4 | 1.3320537428023032 | 0.2380038387715931 | 0.1094891 | 0.4666666666666667 | 0.3380281690140845 | 0.35384615384615387 | UEFA | 0.4539877300613497 | 1.4280230326295584 | 0.3915663 | 0.0 | 0.381957773512476 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.5 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.2 | 0.2 | 0.0 | 0.4 | 0.14285714285714285 | 0.0 | 0.2 |
| 9 | 1971-02-17 | UEFA Euro qualification | ✗ | Albania | Tirana | Germany | 1 | Albania | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.4 | 0.125 | 0.0 | 0.2 |
| 10 | 1971-05-12 | UEFA Euro qualification | ✗ | Albania | Tirana | Poland | 1 | Albania | 1 | 2 | 0 | 4 | 1.6844155844155844 | 0.2519480519480519 | 0.2262774 | 0.4838709677419355 | 0.352112676056338 | 0.4642857142857143 | UEFA | 0.5 | 1.37012987012987 | 0.3373494 | 0.0 | 0.42597402597402595 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 0 | 1 | 0 | 0.7 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.2 | 0.4 | 0.6666666666666666 | 0.2 | 0.1111111111111111 | 0.0 | 0.2 |
| 11 | 1971-06-12 | UEFA Euro qualification | ✗ | Germany | Karlsruhe | Germany | 2 | Albania | 0 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.4 | 0.7 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.4 |
| 12 | 1971-11-14 | UEFA Euro qualification | ✗ | Albania | Tirana | Turkey | 0 | Albania | 3 | 2 | 0 | 4 | 1.3320537428023032 | 0.2380038387715931 | 0.1094891 | 0.4666666666666667 | 0.3380281690140845 | 0.35384615384615387 | UEFA | 0.4539877300613497 | 1.4280230326295584 | 0.3915663 | 0.0 | 0.381957773512476 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 0 | 0 | 1 | 0.3 | 0.0 | 0.2 | 0.0 | 0.0 | 0.2 | 0.2 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.2 |
| 13 | 1982-09-22 | UEFA Euro qualification | ✗ | Austria | Vienna | Austria | 5 | Albania | 0 | 1 | 0 | 4 | 1.7978290366350067 | 0.2198100407055631 | 0.2116788 | 0.41379310344827586 | 0.30633802816901406 | 0.47413793103448276 | UEFA | 0.4837662337662338 | 1.5929443690637721 | 0.3493976 | 0.0 | 0.41112618724559025 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.5 | 0.0 | 0.2 | 0.2 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.6 | 0.1 | 0.3333333333333333 | 0.2 |
| 14 | 1982-10-27 | UEFA Euro qualification | ✗ | Turkey | Izmir | Turkey | 1 | Albania | 0 | 1 | 0 | 4 | 1.3320537428023032 | 0.2380038387715931 | 0.1094891 | 0.4666666666666667 | 0.3380281690140845 | 0.35384615384615387 | UEFA | 0.4539877300613497 | 1.4280230326295584 | 0.3915663 | 0.0 | 0.381957773512476 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.1 | 0.0 | 0.0 | 0.2 | 0.0 | 0.0 | 0.4 | 0.6666666666666666 | 0.2 | 0.1 | 0.3333333333333333 | 0.2 |
| 15 | 1982-12-15 | UEFA Euro qualification | ✗ | Albania | Tirana | Northern Ireland | 0 | Albania | 0 | 2 | 0 | 3 | 1.043117744610282 | 0.23217247097844113 | 0.0948905 | 0.23076923076923078 | 0.1721311475409836 | 0.30327868852459017 | UEFA | 0.29017857142857145 | 1.9535655058043118 | 0.3674699 | 0.0 | 0.24378109452736318 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 0 | 1 | 0 | 0.2 | 0.3333333333333333 | 0.2 | 0.1 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.0 | 0.1 | 0.3333333333333333 | 0.2 |
| 16 | 1983-03-30 | UEFA Euro qualification | ✗ | Albania | Tirana | Germany | 2 | Albania | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.2 | 0.5 | 0.0 | 0.0 | 0.1 | 0.0 | 0.2 |
| 17 | 1983-04-27 | UEFA Euro qualification | ✗ | Northern Ireland | Belfast | Northern Ireland | 1 | Albania | 0 | 1 | 0 | 3 | 1.043117744610282 | 0.23217247097844113 | 0.0948905 | 0.23076923076923078 | 0.1721311475409836 | 0.30327868852459017 | UEFA | 0.29017857142857145 | 1.9535655058043118 | 0.3674699 | 0.0 | 0.24378109452736318 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.3 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.2 | 0.1 | 0.0 | 0.2 |
| 18 | 1983-05-11 | UEFA Euro qualification | ✗ | Albania | Tirana | Turkey | 1 | Albania | 1 | 2 | 0 | 4 | 1.3320537428023032 | 0.2380038387715931 | 0.1094891 | 0.4666666666666667 | 0.3380281690140845 | 0.35384615384615387 | UEFA | 0.4539877300613497 | 1.4280230326295584 | 0.3915663 | 0.0 | 0.381957773512476 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 0 | 1 | 0 | 0.1 | 0.0 | 0.2 | 0.0 | 0.0 | 0.2 | 0.4 | 0.0 | 0.0 | 0.1 | 0.0 | 0.2 |
| 19 | 1983-06-08 | UEFA Euro qualification | ✗ | Albania | Tirana | Austria | 2 | Albania | 1 | 2 | 0 | 4 | 1.7978290366350067 | 0.2198100407055631 | 0.2116788 | 0.41379310344827586 | 0.30633802816901406 | 0.47413793103448276 | UEFA | 0.4837662337662338 | 1.5929443690637721 | 0.3493976 | 0.0 | 0.41112618724559025 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.5 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.4 | 0.5 | 0.6666666666666666 | 0.2 | 0.1 | 0.0 | 0.4 |
| 20 | 1983-11-20 | UEFA Euro qualification | ✗ | Germany | Saarbrücken | Germany | 2 | Albania | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 0.0 | 0.17307692307692307 | 0.14893617021276595 | UEFA | 0.40425531914893614 | 1.595890410958904 | 0.2831325 | 0.0 | 0.23972602739726026 | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.4 | 0.6 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.4 |
Direct Confrontation¶
# Victory 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "victory_team1",
by = ["team1", "team2"],
order_by = ["date"],
name = "avg_victory_direct_team1_1_5",
)
# Victory 3 previous games
all_matchs.rolling(
func = "avg",
window = (-3, -1),
columns = "victory_team1",
by = ["team1", "team2"],
order_by = ["date"],
name = "avg_victory_direct_team1_1_3",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team1", "team2"],
order_by = ["date"],
name = "avg_draw_direct_team1_1_5",
)
📅 dateDate | Abc tournamentVarchar(50) | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 Percent_Victory_Continental_Tournament_2Double | Abc confederation_2Varchar(8) | 123 Percent_Victory_Home_2Double | 123 Avg_goals_conceded_2Double | 123 Number_Games_Continental_Tournament_2Decimal(28,7) | 123 nb_Continental_Cup_2Decimal(27,6) | 123 Percent_Victory_2Double | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Double | 123 avg_victory_same_tournament_team1_1_3Double | 123 avg_draw_same_tournament_team1_1_5Double | 123 avg_victory_same_tournament_team2_1_10Double | 123 avg_victory_same_tournament_team2_1_3Double | 123 avg_draw_same_tournament_team2_1_5Double | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2014-06-01 | CONIFA World Football Cup | ✓ | Sweden | Östersund | Abkhazia | 1 | Occitania | 1 | 1 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | ... | 0.0 | OFC | 0.0 | 1.8333333333333333 | 0.0 | 0.0 | 0.25 | 0 | 1 | 0 | 0.0 | 0.0 | 0.0 | 0.125 | 0.3333333333333333 | 0.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] |
| 2 | 2014-06-07 | CONIFA World Football Cup | ✓ | Sweden | Östersund | Abkhazia | 0 | Occitania | 1 | 1 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | ... | 0.0 | OFC | 0.0 | 1.8333333333333333 | 0.0 | 0.0 | 0.25 | 0 | 0 | 1 | 0.2 | 0.3333333333333333 | 0.6 | 0.2 | 0.3333333333333333 | 0.4 | 0.25 | 0.3333333333333333 | 0.75 | 0.3333333333333333 | 0.3333333333333333 | 0.6666666666666666 | 0.0 | 0.0 | 1.0 |
| 3 | 2018-05-31 | CONIFA World Football Cup | ✓ | England | Enfield | Abkhazia | 3 | Tibet | 0 | 1 | 0 | 0 | 1.0 | 0.5 | 0.0 | 0.0 | 0.16666666666666666 | 0.0 | OFC | 0.0 | 1.5 | 0.0 | 0.0 | 0.16666666666666666 | 0 | ... | 0.0 | OFC | 0.0 | 5.5 | 0.0 | 0.0 | 0.0 | 1 | 0 | 0 | 0.5 | 0.0 | 0.6 | 0.0 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.2 | [null] | [null] | [null] | [null] | [null] | [null] |
| 4 | 2015-06-16 | FIFA World Cup qualification | ✗ | Cambodia | Phnom Penh | Afghanistan | 1 | Cambodia | 0 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.1 | AFC | 0.391304347826087 | 2.6557377049180326 | 0.0903614 | 0.0 | 0.19672131147540983 | 1 | 0 | 0 | 0.2 | 0.3333333333333333 | 0.4 | 0.4 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | [null] | [null] | [null] |
| 5 | 2015-11-12 | FIFA World Cup qualification | ✓ | Iran | Teheran | Afghanistan | 3 | Cambodia | 0 | 1 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.1 | AFC | 0.391304347826087 | 2.6557377049180326 | 0.0903614 | 0.0 | 0.19672131147540983 | 1 | 0 | 0 | 0.2 | 0.0 | 0.0 | 0.3 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 0.2 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 |
| 6 | 2017-06-13 | AFC Asian Cup qualification | ✗ | Cambodia | Phnom Penh | Afghanistan | 0 | Cambodia | 1 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.1 | AFC | 0.391304347826087 | 2.6557377049180326 | 0.0903614 | 0.0 | 0.19672131147540983 | 0 | 0 | 1 | 0.4 | 0.6666666666666666 | 0.4 | 0.2 | 0.0 | 0.0 | 0.1 | 0.3333333333333333 | 0.4 | 0.3 | 0.3333333333333333 | 0.0 | 1.0 | 1.0 | 0.0 |
| 7 | 2018-03-27 | AFC Asian Cup qualification | ✓ | Tajikistan | Dushanbe | Afghanistan | 2 | Cambodia | 1 | 1 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.1 | AFC | 0.391304347826087 | 2.6557377049180326 | 0.0903614 | 0.0 | 0.19672131147540983 | 1 | 0 | 0 | 0.2 | 0.0 | 0.4 | 0.2 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.6 | 0.2 | 0.0 | 0.0 | 0.6666666666666666 | 0.6666666666666666 | 0.0 |
| 8 | 1984-09-12 | AFC Asian Cup qualification | ✗ | China PR | Guangzhou | Afghanistan | 0 | China PR | 6 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.5510204081632653 | AFC | 0.5796178343949044 | 1.0877513711151736 | 0.4427711 | 0.0 | 0.48811700182815354 | 0 | 0 | 1 | 0.1 | 0.0 | 0.2 | 0.4 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.2 | 0.75 | 0.6666666666666666 | 0.0 | [null] | [null] | [null] |
| 9 | 2013-03-06 | AFC Challenge Cup qualification | ✗ | Laos | Vientiane | Afghanistan | 1 | Laos | 1 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.08 | AFC | 0.42857142857142855 | 3.3587786259541983 | 0.0753012 | 0.0 | 0.183206106870229 | 0 | 1 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | 0.3333333333333333 | 0.3333333333333333 | 0.6666666666666666 | [null] | [null] | [null] |
| 10 | 2014-05-24 | AFC Challenge Cup | ✓ | Maldives | Addu City | Afghanistan | 0 | Laos | 0 | 1 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.08 | AFC | 0.42857142857142855 | 3.3587786259541983 | 0.0753012 | 0.0 | 0.183206106870229 | 0 | 1 | 0 | 0.6 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.2 | 0.14285714285714285 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 |
| 11 | 2015-05-29 | Friendly | ✗ | Laos | Vientiane | Afghanistan | 2 | Laos | 0 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.08 | AFC | 0.42857142857142855 | 3.3587786259541983 | 0.0753012 | 0.0 | 0.183206106870229 | 1 | 0 | 0 | 0.3 | 0.0 | 0.4 | 0.3 | 0.0 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 |
| 12 | 2005-12-07 | SAFF Cup | ✓ | Pakistan | Karachi | Afghanistan | 1 | Maldives | 9 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.2 | AFC | 0.36666666666666664 | 2.234848484848485 | 0.0903614 | 0.0 | 0.2803030303030303 | 0 | 0 | 1 | 0.1 | 0.0 | 0.0 | 0.1 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.2 | [null] | [null] | [null] |
| 13 | 2009-12-07 | SAFF Cup | ✓ | Bangladesh | Dhaka | Afghanistan | 1 | Maldives | 3 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.2 | AFC | 0.36666666666666664 | 2.234848484848485 | 0.0903614 | 0.0 | 0.2803030303030303 | 0 | 0 | 1 | 0.1 | 0.0 | 0.2 | 0.6 | 0.6666666666666666 | 0.4 | 0.1111111111111111 | 0.0 | 0.4 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 |
| 14 | 2013-09-06 | SAFF Cup | ✓ | Nepal | Kathmandu | Afghanistan | 0 | Maldives | 0 | 1 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.2 | AFC | 0.36666666666666664 | 2.234848484848485 | 0.0903614 | 0.0 | 0.2803030303030303 | 0 | 1 | 0 | 0.7 | 1.0 | 0.2 | 0.6 | 1.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.0 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 |
| 15 | 2014-05-29 | AFC Challenge Cup | ✗ | Maldives | Malé | Afghanistan | 1 | Maldives | 1 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.2 | AFC | 0.36666666666666664 | 2.234848484848485 | 0.0903614 | 0.0 | 0.2803030303030303 | 0 | 1 | 0 | 0.4 | 0.3333333333333333 | 0.4 | 0.3 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.3333333333333333 | 0.4 | 0.2857142857142857 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.3333333333333333 |
| 16 | 2015-12-28 | SAFF Cup | ✓ | India | Thiruvananthapuram | Afghanistan | 4 | Maldives | 1 | 1 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.2 | AFC | 0.36666666666666664 | 2.234848484848485 | 0.0903614 | 0.0 | 0.2803030303030303 | 1 | 0 | 0 | 0.4 | 1.0 | 0.0 | 0.3 | 0.6666666666666666 | 0.0 | 0.8 | 1.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.5 |
| 17 | 2017-06-06 | Friendly | ✓ | United Arab Emirates | Dubai | Afghanistan | 2 | Maldives | 1 | 1 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.2 | AFC | 0.36666666666666664 | 2.234848484848485 | 0.0903614 | 0.0 | 0.2803030303030303 | 1 | 0 | 0 | 0.4 | 0.3333333333333333 | 0.4 | 0.4 | 0.3333333333333333 | 0.2 | 0.3 | 0.3333333333333333 | 0.2 | 0.3 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 |
| 18 | 2013-03-04 | AFC Challenge Cup qualification | ✓ | Laos | Vientiane | Afghanistan | 1 | Mongolia | 0 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.21428571428571427 | OFC | 1.0 | 3.2222222222222223 | 0.0421687 | 0.0 | 0.26666666666666666 | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.5 | 0.3333333333333333 | 0.2 | 0.625 | 0.6666666666666666 | 0.0 | 0.4 | 0.3333333333333333 | 0.2 | [null] | [null] | [null] |
| 19 | 1975-04-06 | AFC Asian Cup qualification | ✓ | Iraq | Baghdad | Afghanistan | 1 | Qatar | 2 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.41044776119402987 | AFC | 0.4936708860759494 | 1.1829787234042553 | 0.4036145 | 0.0 | 0.4021276595744681 | 0 | 0 | 1 | 0.0 | 0.0 | 0.0 | 0.1 | 0.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] |
| 20 | 1975-04-12 | AFC Asian Cup qualification | ✓ | Iraq | Baghdad | Afghanistan | 1 | Qatar | 1 | 2 | 0 | 2 | 1.0795454545454546 | 0.20454545454545456 | 0.0 | 0.0 | 0.29577464788732394 | 0.16666666666666666 | AFC | 0.4 | 2.0568181818181817 | 0.0361446 | 0.0 | 0.2840909090909091 | 0 | ... | 0.41044776119402987 | AFC | 0.4936708860759494 | 1.1829787234042553 | 0.4036145 | 0.0 | 0.4021276595744681 | 0 | 1 | 0 | 0.0 | 0.0 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.25 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 |
Games against an opponents with the same rank¶
# TEAM 1
# Victory 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "victory_team1",
by = ["team1", "fifa_rank_2"],
order_by = ["date"],
name = "avg_victory_rank2_team1_1_5",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team1", "fifa_rank_2"],
order_by = ["date"],
name = "avg_draw_rank2_team1_1_5",
)
# TEAM 2
# Victory 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "victory_team2",
by = ["team2", "fifa_rank_1"],
order_by = ["date"],
name = "avg_victory_rank1_team2_1_5",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["team2", "fifa_rank_1"],
order_by = ["date"],
name = "avg_draw_rank1_team2_1_5",
)
📅 dateDate | Abc tournamentVarchar(50) | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 Number_Games_Continental_Tournament_2Decimal(28,7) | 123 nb_Continental_Cup_2Decimal(27,6) | 123 Percent_Victory_2Double | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Double | 123 avg_victory_same_tournament_team1_1_3Double | 123 avg_draw_same_tournament_team1_1_5Double | 123 avg_victory_same_tournament_team2_1_10Double | 123 avg_victory_same_tournament_team2_1_3Double | 123 avg_draw_same_tournament_team2_1_5Double | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | 123 avg_victory_rank2_team1_1_5Double | 123 avg_draw_rank2_team1_1_5Double | 123 avg_victory_rank1_team2_1_5Double | 123 avg_draw_rank1_team2_1_5Double | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1998-06-03 | Friendly | ✓ | France | Saint-Ouen | Brazil | 3 | Andorra | 0 | 2 | 4 | 5 | 2.193756727664155 | 0.20021528525296017 | 1.0 | 0.6788321167883211 | 0.59375 | 0.5770609318996416 | CONMEBOL | 0.7333333333333333 | 0.93756727664155 | 0.8403614 | 0.9 | 0.635091496232508 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.8 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] |
| 2 | 1998-10-14 | UEFA Euro qualification | ✗ | France | Saint-Denis | France | 2 | Andorra | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 1.0 | 0.0 | 0.0 | 0.0 |
| 3 | 1999-06-09 | UEFA Euro qualification | ✓ | Spain | Barcelona | France | 1 | Andorra | 0 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.6 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.6 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 |
| 4 | 2004-05-28 | Friendly | ✗ | France | Montpellier | France | 4 | Andorra | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.8 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.2 | 0.6 | 0.3333333333333333 | 0.4 | 0.2 | 0.0 | 0.2 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 |
| 5 | 2004-06-05 | Friendly | ✗ | Spain | Getafe | Spain | 4 | Andorra | 0 | 1 | 1 | 5 | 1.9674418604651163 | 0.2248062015503876 | 0.5036496 | 0.5217391304347826 | 0.46568627450980393 | 0.6223776223776224 | UEFA | 0.6768558951965066 | 0.9085271317829458 | 0.4307229 | 0.3 | 0.5813953488372093 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.7 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.2 | 0.7 | 0.6666666666666666 | 0.2 | 0.2 | 0.0 | 0.2 | [null] | [null] | [null] | 1.0 | 0.0 | 0.0 | 0.0 |
| 6 | 2006-09-02 | UEFA Euro qualification | ✗ | England | Manchester | England | 5 | Andorra | 0 | 1 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.8 | 0.6666666666666666 | 0.4 | 0.0 | 0.0 | 0.2 | 0.7 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 1.0 | 0.0 | 0.0 | 0.0 |
| 7 | 2007-03-28 | UEFA Euro qualification | ✓ | Spain | Barcelona | England | 3 | Andorra | 0 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.4 | 0.0 | 0.6 | 0.0 | 0.0 | 0.2 | 0.6 | 0.0 | 0.4 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 |
| 8 | 2008-09-06 | FIFA World Cup qualification | ✓ | Spain | Barcelona | England | 2 | Andorra | 0 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.2 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 |
| 9 | 2009-06-10 | FIFA World Cup qualification | ✗ | England | London | England | 6 | Andorra | 0 | 1 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.8 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.9 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 |
| 10 | 2019-06-11 | UEFA Euro qualification | ✗ | Andorra | Andorra la Vella | France | 4 | Andorra | 0 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.4 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.8 | 0.2 | 0.0 | 0.0 |
| 11 | 2019-09-10 | UEFA Euro qualification | ✗ | France | Paris | France | 3 | Andorra | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.126506 | 0.0 | 0.022900763358778626 | 1 | 0 | 0 | 0.7 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.8 | 0.2 | 0.0 | 0.0 |
| 12 | 1991-05-16 | CFU Caribbean Cup qualification | ✗ | Saint Lucia | Castries | Saint Lucia | 6 | Anguilla | 0 | 1 | 0 | 2 | 1.4731182795698925 | 0.13978494623655913 | 0.0 | 0.0 | 0.308411214953271 | 0.2727272727272727 | OFC | 0.40350877192982454 | 1.9623655913978495 | 0.0662651 | 0.0 | 0.3333333333333333 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.3 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.5 | 0.3333333333333333 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 1.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] |
| 13 | 1993-04-04 | CFU Caribbean Cup qualification | ✗ | Anguilla | The Valley | Antigua and Barbuda | 4 | Anguilla | 0 | 2 | 0 | 2 | 1.3954802259887005 | 0.20903954802259886 | 0.0 | 0.0 | 0.23333333333333334 | 0.2777777777777778 | OFC | 0.47058823529411764 | 1.7005649717514124 | 0.1084337 | 0.0 | 0.3107344632768362 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.3 | 0.0 | 0.2 | 0.0 | 0.0 | 0.2 | 0.5 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.25 | [null] | [null] | [null] | 0.0 | 0.0 | 0.0 | 0.0 |
| 14 | 1994-03-04 | CFU Caribbean Cup qualification | ✓ | Saint Vincent and the Grenadines | Kingstown | Guadeloupe | 9 | Anguilla | 0 | 1 | 0 | 2 | 1.6712328767123288 | 0.182648401826484 | 0.0 | 0.0 | 0.38028169014084506 | 0.3333333333333333 | CONCACAF | 0.5076923076923077 | 1.4840182648401827 | 0.0361446 | 0.0 | 0.4155251141552511 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.1 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.2 | 0.0 | 0.2 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 0.6 | 0.0 | 0.0 | 0.0 |
| 15 | 1994-03-06 | CFU Caribbean Cup qualification | ✗ | Saint Vincent and the Grenadines | Kingstown | Saint Vincent and the Grenadines | 2 | Anguilla | 0 | 1 | 0 | 2 | 1.7619047619047619 | 0.2698412698412698 | 0.0 | 0.0 | 0.4050632911392405 | 0.5384615384615384 | OFC | 0.5294117647058824 | 1.3174603174603174 | 0.0391566 | 0.0 | 0.4523809523809524 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.4 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 0.5 | 0.5 | 0.0 | 0.0 |
| 16 | 1996-03-27 | CFU Caribbean Cup qualification | ✗ | Saint Kitts and Nevis | Basseterre | Saint Kitts and Nevis | 8 | Anguilla | 0 | 1 | 0 | 2 | 1.7973856209150327 | 0.1895424836601307 | 0.0 | 0.0 | 0.3064516129032258 | 0.34615384615384615 | OFC | 0.5076923076923077 | 1.5947712418300655 | 0.0783133 | 0.0 | 0.39869281045751637 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.3 | 0.0 | 0.4 | 0.0 | 0.0 | 0.0 | 0.5 | 0.0 | 0.4 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 0.4 | 0.4 | 0.0 | 0.0 |
| 17 | 1998-04-15 | CFU Caribbean Cup qualification | ✓ | Antigua and Barbuda | St. John's | Grenada | 14 | Anguilla | 1 | 1 | 0 | 2 | 1.7894736842105263 | 0.22105263157894736 | 0.0 | 0.0 | 0.35398230088495575 | 0.25925925925925924 | CONCACAF | 0.4 | 1.763157894736842 | 0.0813253 | 0.0 | 0.3526315789473684 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.4 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.4 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 0.5 | 0.5 | 0.0 | 0.0 |
| 18 | 1998-04-19 | CFU Caribbean Cup qualification | ✓ | Antigua and Barbuda | St. John's | Guyana | 14 | Anguilla | 0 | 1 | 0 | 2 | 1.1983471074380165 | 0.2066115702479339 | 0.0 | 0.0 | 0.2564102564102564 | 0.21875 | CONCACAF | 0.3870967741935484 | 1.7479338842975207 | 0.0963855 | 0.0 | 0.30165289256198347 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.2 | 0.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.2 | 0.0 | 0.2 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | 0.4 | 0.4 | 0.0 | 0.0 |
| 19 | 2000-03-05 | FIFA World Cup qualification | ✗ | Anguilla | The Valley | Bahamas | 3 | Anguilla | 1 | 2 | 0 | 2 | 1.1481481481481481 | 0.14814814814814814 | 0.0 | 0.0 | 0.18181818181818182 | 0.3076923076923077 | OFC | 0.3333333333333333 | 3.3333333333333335 | 0.0391566 | 0.0 | 0.25925925925925924 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.14285714285714285 | 0.0 | 0.2 | 0.1 | 0.3333333333333333 | 0.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0.25 | 0.25 | 0.0 | 0.0 |
| 20 | 2000-03-19 | FIFA World Cup qualification | ✗ | Bahamas | Nassau | Bahamas | 2 | Anguilla | 1 | 1 | 0 | 2 | 1.1481481481481481 | 0.14814814814814814 | 0.0 | 0.0 | 0.18181818181818182 | 0.3076923076923077 | OFC | 0.3333333333333333 | 3.3333333333333335 | 0.0391566 | 0.0 | 0.25925925925925924 | 0 | ... | 0.0271084 | 0.0 | 0.0625 | 1 | 0 | 0 | 0.25 | 0.3333333333333333 | 0.0 | 0.1 | 0.3333333333333333 | 0.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.4 | 0.2 | 0.0 | 0.0 |
Games between teams with rank 1 and rank 2¶
# Victory 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "victory_team1",
by = ["fifa_rank_1", "fifa_rank_2"],
order_by = ["date"],
name = "avg_victory_rank1_rank2_team1_1_5",
)
# Draw 5 previous games
all_matchs.rolling(
func = "avg",
window = (-5, -1),
columns = "draw",
by = ["fifa_rank_1", "fifa_rank_2"],
order_by = ["date"],
name = "avg_draw_rank1_rank2_team1_1_5",
)
📅 dateDate | Abc tournamentVarchar(50) | 0|1 neutralBoolean | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 Percent_Victory_2Double | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Double | 123 avg_victory_same_tournament_team1_1_3Double | 123 avg_draw_same_tournament_team1_1_5Double | 123 avg_victory_same_tournament_team2_1_10Double | 123 avg_victory_same_tournament_team2_1_3Double | 123 avg_draw_same_tournament_team2_1_5Double | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | 123 avg_victory_rank2_team1_1_5Double | 123 avg_draw_rank2_team1_1_5Double | 123 avg_victory_rank1_team2_1_5Double | 123 avg_draw_rank1_team2_1_5Double | 123 avg_victory_rank1_rank2_team1_1_5Double | 123 avg_draw_rank1_rank2_team1_1_5Double | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1911-10-29 | Friendly | ✗ | Luxembourg | Luxembourg | France | 4 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.1 | 0.0 | 0.2 | [null] | [null] | [null] | 0.1 | 0.0 | 0.2 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] |
| 2 | 1913-04-20 | Friendly | ✗ | France | Saint-Ouen | France | 8 | Luxembourg | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 3 | 1914-02-08 | Friendly | ✗ | Luxembourg | Luxembourg | France | 4 | Luxembourg | 5 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.06906077348066299 | 0 | 0 | 1 | 0.7 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.7 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 4 | 1927-05-21 | Friendly | ✗ | Luxembourg | Esch-sur-Alzette | England | 5 | Luxembourg | 2 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.4 | 0.6666666666666666 | 0.4 | 0.2 | 0.3333333333333333 | 0.2 | 0.9 | 1.0 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | [null] | [null] | [null] | [null] | [null] | 0.3333333333333333 | 0.0 | 0.6666666666666666 | 0.0 |
| 5 | 1934-03-11 | FIFA World Cup qualification | ✗ | Luxembourg | Luxembourg | Germany | 9 | Luxembourg | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.5 | 1.0 | 0.2 | 0.14285714285714285 | 0.0 | 0.4 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0.25 | 0.0 | 0.75 | 0.0 |
| 6 | 1934-04-15 | FIFA World Cup qualification | ✗ | Luxembourg | Luxembourg | France | 6 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.0 | 0.125 | 0.0 | 0.4 | [null] | [null] | [null] | 0.0 | 0.0 | 0.0 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | 0.6666666666666666 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 7 | 1935-08-18 | Friendly | ✗ | Luxembourg | Luxembourg | Germany | 1 | Luxembourg | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.4 | 0.7 | 0.3333333333333333 | 0.2 | 0.14285714285714285 | 0.0 | 0.4 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 8 | 1936-09-27 | Friendly | ✗ | Germany | Krefeld | Germany | 7 | Luxembourg | 2 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.1 | 0.0 | 0.2 | 0.7 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.4 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 9 | 1937-03-21 | Friendly | ✗ | Luxembourg | Luxembourg | Germany | 3 | Luxembourg | 2 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.4 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.2 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 10 | 1938-03-20 | Friendly | ✗ | Germany | Wuppertal | Germany | 2 | Luxembourg | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.9 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 0.7 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 11 | 1939-03-26 | Friendly | ✗ | Luxembourg | Differdange | Germany | 1 | Luxembourg | 2 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 0 | 0 | 1 | 0.5 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 12 | 1951-12-23 | Friendly | ✗ | Germany | Essen | Germany | 4 | Luxembourg | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.7 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 | 0.7 | 0.6666666666666666 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 13 | 1952-04-20 | Friendly | ✗ | Luxembourg | Luxembourg | Germany | 3 | Luxembourg | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.8 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.8 | 0.6666666666666666 | 0.0 | 0.3 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 14 | 1953-09-20 | FIFA World Cup qualification | ✗ | Luxembourg | Luxembourg | France | 6 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.6 | 0.3333333333333333 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | 0.25 | 0.0 | 0.5 | 0.0 | 0.0 | 0.0 | 0.75 | 0.6666666666666666 | 0.0 | 0.75 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 15 | 1953-12-17 | FIFA World Cup qualification | ✗ | France | Paris | France | 8 | Luxembourg | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.5 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 0.5714285714285714 | 1.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 |
| 16 | 1954-03-28 | FIFA World Cup qualification | ✗ | Saarland | Saarbrücken | Germany | 3 | Saarland | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.0 | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.8 | 0.0 | 0.0 | 1.0 | 0.8333333333333334 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 1.0 | [null] | [null] | [null] | 0.8 | 0.0 | [null] | [null] | 0.8 | 0.0 |
| 17 | 1954-06-05 | Friendly | ✗ | Saarland | Saarbrücken | Uruguay | 7 | Saarland | 1 | 2 | 1 | 5 | 1.5756853396901074 | 0.24553039332538737 | 0.4452555 | 0.4098360655737705 | 0.3007246376811594 | 0.5060240963855421 | CONMEBOL | 0.5 | 1.264600715137068 | 1.0 | 0.8 | 0.4302741358760429 | 0 | ... | 0.0 | 1 | 0 | 0 | 0.4 | 0.0 | 0.4 | 0.0 | 0.0 | 0.5 | 0.2 | 0.0 | 0.4 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0.0 | 0.0 | 1.0 | 0.0 |
| 18 | 1957-03-10 | Friendly | ✗ | German DR | Berlin | Germany | 3 | Luxembourg | 0 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 1.0 | 0.0 |
| 19 | 1960-10-19 | FIFA World Cup qualification | ✗ | Luxembourg | Luxembourg | England | 9 | Luxembourg | 0 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 0.9 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 20 | 1961-09-28 | FIFA World Cup qualification | ✗ | England | London | England | 4 | Luxembourg | 1 | 1 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 0.06906077348066299 | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
Before we use the neutral variable with our model, we should convert it to an integer.
We need also to create our response column: the outcome of the game.
all_matchs["neutral"].astype("int")
all_matchs.case_when(
"result",
all_matchs["team1_score"] > all_matchs["team2_score"], "1",
all_matchs["team1_score"] < all_matchs["team2_score"], "2",
"X",
)
📅 dateDate | Abc tournamentVarchar(50) | 123 neutralInt | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Double | 123 avg_victory_same_tournament_team1_1_3Double | 123 avg_draw_same_tournament_team1_1_5Double | 123 avg_victory_same_tournament_team2_1_10Double | 123 avg_victory_same_tournament_team2_1_3Double | 123 avg_draw_same_tournament_team2_1_5Double | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | 123 avg_victory_rank2_team1_1_5Double | 123 avg_draw_rank2_team1_1_5Double | 123 avg_victory_rank1_team2_1_5Double | 123 avg_draw_rank1_team2_1_5Double | 123 avg_victory_rank1_rank2_team1_1_5Double | 123 avg_draw_rank1_rank2_team1_1_5Double | Abc resultVarchar(1) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1923-11-01 | Friendly | 0 | France | Rennes | Norway | 5 | Brittany | 1 | 2 | 0 | 3 | 1.5013089005235603 | 0.22774869109947643 | 0.0583942 | 0.25 | 0.3343465045592705 | 0.3474576271186441 | UEFA | 0.3948220064724919 | 1.6845549738219896 | 0.3554217 | 0.0 | 0.3599476439790576 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.3333333333333333 | 0.2 | 1.0 | 1.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.2 | 1.0 | 1.0 | 0.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 1 |
| 2 | 1929-05-01 | Friendly | 0 | El Salvador | San Salvador | El Salvador | 9 | Nicaragua | 0 | 1 | 0 | 3 | 1.2262931034482758 | 0.22629310344827586 | 0.0437956 | 0.0 | 0.2009132420091324 | 0.4166666666666667 | CONCACAF | 0.4819277108433735 | 1.4870689655172413 | 0.4698795 | 0.0 | 0.32112068965517243 | 0 | ... | 1 | 0 | 0 | 0.25 | 0.3333333333333333 | 0.25 | [null] | [null] | [null] | 0.25 | 0.3333333333333333 | 0.25 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 1.0 | 0.0 | 1 |
| 3 | 1937-08-22 | Friendly | 0 | Norway | Oslo | Norway | 1 | Basque Country | 3 | 1 | 0 | 3 | 1.5013089005235603 | 0.22774869109947643 | 0.0583942 | 0.25 | 0.3343465045592705 | 0.3474576271186441 | UEFA | 0.3948220064724919 | 1.6845549738219896 | 0.3554217 | 0.0 | 0.3599476439790576 | 0 | ... | 0 | 0 | 1 | 0.1 | 0.0 | 0.4 | 0.7 | 0.3333333333333333 | 0.0 | 0.2 | 0.0 | 0.2 | 0.7 | 0.3333333333333333 | 0.0 | [null] | [null] | [null] | 1.0 | 0.0 | [null] | [null] | 1.0 | 0.0 | 2 |
| 4 | 1938-05-29 | Friendly | 0 | Cuba | Havana | Cuba | 0 | Basque Country | 4 | 1 | 0 | 3 | 1.3205128205128205 | 0.25 | 0.0218978 | 0.3333333333333333 | 0.3728813559322034 | 0.25 | CONCACAF | 0.45 | 1.439102564102564 | 0.2771084 | 0.0 | 0.34615384615384615 | 0 | ... | 0 | 0 | 1 | 0.3333333333333333 | 0.0 | 0.2 | 0.7 | 0.6666666666666666 | 0.0 | [null] | [null] | [null] | 0.7 | 0.6666666666666666 | 0.0 | [null] | [null] | [null] | [null] | [null] | 1.0 | 0.0 | 0.6666666666666666 | 0.0 | 2 |
| 5 | 1938-06-20 | Friendly | 0 | Cuba | Havana | Cuba | 3 | Basque Country | 4 | 1 | 0 | 3 | 1.3205128205128205 | 0.25 | 0.0218978 | 0.3333333333333333 | 0.3728813559322034 | 0.25 | CONCACAF | 0.45 | 1.439102564102564 | 0.2771084 | 0.0 | 0.34615384615384615 | 0 | ... | 0 | 0 | 1 | 0.3 | 0.3333333333333333 | 0.2 | 0.7 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.7 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.5 | 0.0 | 2 |
| 6 | 1941-05-13 | CCCF Championship | 1 | Costa Rica | San José | El Salvador | 8 | Nicaragua | 0 | 1 | 0 | 3 | 1.2262931034482758 | 0.22629310344827586 | 0.0437956 | 0.0 | 0.2009132420091324 | 0.4166666666666667 | CONCACAF | 0.4819277108433735 | 1.4870689655172413 | 0.4698795 | 0.0 | 0.32112068965517243 | 0 | ... | 1 | 0 | 0 | 0.42857142857142855 | 0.6666666666666666 | 0.4 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.4 | 0.0 | 1 |
| 7 | 1943-12-07 | CCCF Championship | 0 | El Salvador | San Salvador | El Salvador | 8 | Nicaragua | 1 | 1 | 0 | 3 | 1.2262931034482758 | 0.22629310344827586 | 0.0437956 | 0.0 | 0.2009132420091324 | 0.4166666666666667 | CONCACAF | 0.4819277108433735 | 1.4870689655172413 | 0.4698795 | 0.0 | 0.32112068965517243 | 0 | ... | 1 | 0 | 0 | 0.5 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.4 | 0.0 | 1 |
| 8 | 1943-12-09 | CCCF Championship | 1 | El Salvador | San Salvador | Guatemala | 6 | Nicaragua | 2 | 1 | 0 | 3 | 1.3293838862559242 | 0.25829383886255924 | 0.0 | 0.0 | 0.2857142857142857 | 0.33093525179856115 | CONCACAF | 0.46808510638297873 | 1.3696682464454977 | 0.4186747 | 0.0 | 0.3412322274881517 | 0 | ... | 1 | 0 | 0 | 0.2222222222222222 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 0.5 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | [null] | [null] | [null] | [null] | [null] | 0.0 | 0.0 | 0.4 | 0.0 | 1 |
| 9 | 1943-12-16 | CCCF Championship | 0 | El Salvador | San Salvador | El Salvador | 10 | Nicaragua | 1 | 1 | 0 | 3 | 1.2262931034482758 | 0.22629310344827586 | 0.0437956 | 0.0 | 0.2009132420091324 | 0.4166666666666667 | CONCACAF | 0.4819277108433735 | 1.4870689655172413 | 0.4698795 | 0.0 | 0.32112068965517243 | 0 | ... | 1 | 0 | 0 | 0.7 | 1.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.625 | 1.0 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.0 | 1 |
| 10 | 1943-12-19 | CCCF Championship | 1 | El Salvador | San Salvador | Guatemala | 5 | Nicaragua | 1 | 2 | 0 | 3 | 1.3293838862559242 | 0.25829383886255924 | 0.0 | 0.0 | 0.2857142857142857 | 0.33093525179856115 | CONCACAF | 0.46808510638297873 | 1.3696682464454977 | 0.4186747 | 0.0 | 0.3412322274881517 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 0.6 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.8 | 0.0 | 1 |
| 11 | 1946-02-28 | CCCF Championship | 1 | Costa Rica | San José | El Salvador | 7 | Nicaragua | 2 | 1 | 0 | 3 | 1.2262931034482758 | 0.22629310344827586 | 0.0437956 | 0.0 | 0.2009132420091324 | 0.4166666666666667 | CONCACAF | 0.4819277108433735 | 1.4870689655172413 | 0.4698795 | 0.0 | 0.32112068965517243 | 0 | ... | 1 | 0 | 0 | 0.6 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 12 | 1946-03-07 | CCCF Championship | 1 | Costa Rica | San José | Guatemala | 7 | Nicaragua | 0 | 1 | 0 | 3 | 1.3293838862559242 | 0.25829383886255924 | 0.0 | 0.0 | 0.2857142857142857 | 0.33093525179856115 | CONCACAF | 0.46808510638297873 | 1.3696682464454977 | 0.4186747 | 0.0 | 0.3412322274881517 | 0 | ... | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.625 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 13 | 1946-03-13 | CCCF Championship | 1 | Costa Rica | San José | Honduras | 10 | Nicaragua | 0 | 1 | 0 | 3 | 1.4914893617021276 | 0.26170212765957446 | 0.0656934 | 0.0 | 0.3316062176165803 | 0.44 | CONMEBOL | 0.5483870967741935 | 1.2234042553191489 | 0.5271084 | 0.0 | 0.4085106382978723 | 0 | ... | 1 | 0 | 0 | 0.25 | 0.3333333333333333 | 0.0 | 0.1 | 0.3333333333333333 | 0.0 | 0.25 | 0.3333333333333333 | 0.0 | 0.1 | 0.3333333333333333 | 0.0 | [null] | [null] | [null] | [null] | [null] | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 14 | 1949-05-09 | Friendly | 1 | Suriname | Parmaribo | Cuba | 0 | Martinique | 0 | 1 | 0 | 3 | 1.3205128205128205 | 0.25 | 0.0218978 | 0.3333333333333333 | 0.3728813559322034 | 0.25 | CONCACAF | 0.45 | 1.439102564102564 | 0.2771084 | 0.0 | 0.34615384615384615 | 0 | ... | 0 | 1 | 0 | 0.5 | 0.0 | 0.4 | 0.7 | 0.6666666666666666 | 0.0 | 0.4 | 0.0 | 0.4 | 0.7 | 0.6666666666666666 | 0.0 | [null] | [null] | [null] | 0.0 | 0.0 | [null] | [null] | 1.0 | 0.0 | X |
| 15 | 1949-07-01 | Friendly | 0 | Martinique | Fort-de-France | Trinidad and Tobago | 0 | Martinique | 2 | 2 | 0 | 3 | 1.739967897271268 | 0.2102728731942215 | 0.0218978 | 0.0 | 0.3763440860215054 | 0.3793103448275862 | CONCACAF | 0.6224489795918368 | 1.274478330658106 | 0.436747 | 0.0 | 0.45264847512038525 | 0 | ... | 0 | 0 | 1 | 0.6 | 1.0 | 0.0 | 0.6 | 0.3333333333333333 | 0.2 | 0.6 | 1.0 | 0.0 | 0.6 | 0.3333333333333333 | 0.2 | [null] | [null] | [null] | [null] | [null] | 0.0 | 1.0 | 0.8 | 0.2 | 2 |
| 16 | 1952-08-24 | Friendly | 0 | Poland | Chorzów | China PR | 1 | Silesia | 5 | 2 | 0 | 3 | 1.8372943327239488 | 0.226691042047532 | 0.0218978 | 0.0 | 0.3958333333333333 | 0.5510204081632653 | AFC | 0.5796178343949044 | 1.0877513711151736 | 0.4427711 | 0.0 | 0.48811700182815354 | 0 | ... | 0 | 0 | 1 | 0.5 | 0.3333333333333333 | 0.0 | 0.3333333333333333 | 0.3333333333333333 | 0.0 | 0.5 | 0.3333333333333333 | 0.0 | 0.3333333333333333 | 0.3333333333333333 | 0.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0.6 | 0.2 | 2 |
| 17 | 1953-03-08 | CCCF Championship | 1 | Costa Rica | San José | Honduras | 2 | Nicaragua | 1 | 1 | 0 | 3 | 1.4914893617021276 | 0.26170212765957446 | 0.0656934 | 0.0 | 0.3316062176165803 | 0.44 | CONMEBOL | 0.5483870967741935 | 1.2234042553191489 | 0.5271084 | 0.0 | 0.4085106382978723 | 0 | ... | 1 | 0 | 0 | 0.3333333333333333 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.4 | 0.2 | 1 |
| 18 | 1953-03-10 | CCCF Championship | 1 | Costa Rica | San José | El Salvador | 4 | Nicaragua | 1 | 1 | 0 | 3 | 1.2262931034482758 | 0.22629310344827586 | 0.0437956 | 0.0 | 0.2009132420091324 | 0.4166666666666667 | CONCACAF | 0.4819277108433735 | 1.4870689655172413 | 0.4698795 | 0.0 | 0.32112068965517243 | 0 | ... | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.0 | 0.2 | 0.0 | 0.2 | 0.1 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.4 | 0.2 | 1 |
| 19 | 1953-03-19 | CCCF Championship | 1 | Costa Rica | San José | Guatemala | 1 | Nicaragua | 0 | 1 | 0 | 3 | 1.3293838862559242 | 0.25829383886255924 | 0.0 | 0.0 | 0.2857142857142857 | 0.33093525179856115 | CONCACAF | 0.46808510638297873 | 1.3696682464454977 | 0.4186747 | 0.0 | 0.3412322274881517 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.6666666666666666 | 0.4 | 0.1 | 0.3333333333333333 | 0.0 | 0.4 | 0.6666666666666666 | 0.4 | 0.1 | 0.3333333333333333 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.4 | 0.2 | 1 |
| 20 | 1956-09-12 | AFC Asian Cup | 1 | Hong Kong | So Kon Po | Israel | 2 | Vietnam Republic | 1 | 1 | 0 | 3 | 1.4547738693467336 | 0.25125628140703515 | 0.0218978 | 0.0 | 0.30327868852459017 | 0.3548387096774194 | UEFA | 0.38926174496644295 | 1.4522613065326633 | 0.373494 | 0.1 | 0.3492462311557789 | 0 | ... | 1 | 0 | 0 | 0.2 | 0.6666666666666666 | 0.2 | 0.3333333333333333 | 0.3333333333333333 | 0.6666666666666666 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 1.0 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 0.6 | 0.0 | 1 |
We have some missing values here. This might be because the two teams never played together, the competition was one or both teams’ first, etc.
all_matchs.count()
| count | |
|---|---|
| "date" | 82818.0 |
| "tournament" | 82818.0 |
| "neutral" | 82818.0 |
| "country" | 82818.0 |
| "city" | 82818.0 |
| "team1" | 82818.0 |
| "team1_score" | 82818.0 |
| "team2" | 82818.0 |
| "team2_score" | 82818.0 |
| "match_sample" | 82818.0 |
| "nb_World_Cup_1" | 82765.0 |
| "fifa_rank_1" | 82765.0 |
| "Avg_goals_1" | 82765.0 |
| "Percent_Draw_1" | 82765.0 |
| "Number_Games_World_Tournament_1" | 82765.0 |
| "Percent_Victory_World_Tournament_1" | 82765.0 |
| "Percent_Victory_Away_1" | 82765.0 |
| "Percent_Victory_Continental_Tournament_1" | 82765.0 |
| "confederation_1" | 82765.0 |
| "Percent_Victory_Home_1" | 82765.0 |
| "Avg_goals_conceded_1" | 82765.0 |
| "Number_Games_Continental_Tournament_1" | 82765.0 |
| "nb_Continental_Cup_1" | 82765.0 |
| "Percent_Victory_1" | 82765.0 |
| "nb_World_Cup_2" | 82765.0 |
| "fifa_rank_2" | 82765.0 |
| "Avg_goals_2" | 82765.0 |
| "Percent_Draw_2" | 82765.0 |
| "Number_Games_World_Tournament_2" | 82765.0 |
| "Percent_Victory_World_Tournament_2" | 82765.0 |
| "Percent_Victory_Away_2" | 82765.0 |
| "Percent_Victory_Continental_Tournament_2" | 82765.0 |
| "confederation_2" | 82765.0 |
| "Percent_Victory_Home_2" | 82765.0 |
| "Avg_goals_conceded_2" | 82765.0 |
| "Number_Games_Continental_Tournament_2" | 82765.0 |
| "nb_Continental_Cup_2" | 82765.0 |
| "Percent_Victory_2" | 82765.0 |
| "victory_team1" | 82818.0 |
| "draw" | 82818.0 |
| "victory_team2" | 82818.0 |
| "avg_victory_team1_1_10" | 82539.0 |
| "avg_victory_team1_1_3" | 82539.0 |
| "avg_draw_team1_1_5" | 82539.0 |
| "avg_victory_team2_1_10" | 82539.0 |
| "avg_victory_team2_1_3" | 82539.0 |
| "avg_draw_team2_1_5" | 82539.0 |
| "avg_victory_same_tournament_team1_1_10" | 80706.0 |
| "avg_victory_same_tournament_team1_1_3" | 80706.0 |
| "avg_draw_same_tournament_team1_1_5" | 80706.0 |
| "avg_victory_same_tournament_team2_1_10" | 80706.0 |
| "avg_victory_same_tournament_team2_1_3" | 80706.0 |
| "avg_draw_same_tournament_team2_1_5" | 80706.0 |
| "avg_victory_direct_team1_1_5" | 69759.0 |
| "avg_victory_direct_team1_1_3" | 69759.0 |
| "avg_draw_direct_team1_1_5" | 69759.0 |
| "avg_victory_rank2_team1_1_5" | 81440.0 |
| "avg_draw_rank2_team1_1_5" | 81440.0 |
| "avg_victory_rank1_team2_1_5" | 81440.0 |
| "avg_draw_rank1_team2_1_5" | 81440.0 |
| "avg_victory_rank1_rank2_team1_1_5" | 82771.0 |
| "avg_draw_rank1_rank2_team1_1_5" | 82771.0 |
| "result" | 82818.0 |
We need to impute these missing values.
all_matchs["avg_victory_direct_team1_1_5"] = fun.coalesce(
all_matchs["avg_victory_direct_team1_1_5"],
all_matchs["avg_victory_rank2_team1_1_5"],
all_matchs["avg_victory_rank1_rank2_team1_1_5"],
)
all_matchs["avg_victory_direct_team1_1_3"] = fun.coalesce(
all_matchs["avg_victory_direct_team1_1_3"],
all_matchs["avg_victory_rank2_team1_1_5"],
all_matchs["avg_victory_rank1_rank2_team1_1_5"],
)
all_matchs["avg_draw_direct_team1_1_5"] = fun.coalesce(
all_matchs["avg_draw_direct_team1_1_5"],
all_matchs["avg_draw_rank2_team1_1_5"],
all_matchs["avg_draw_rank1_rank2_team1_1_5"],
)
all_matchs["avg_victory_same_tournament_team1_1_10"].fillna(expr = "avg_victory_team1_1_10")
all_matchs["avg_victory_same_tournament_team1_1_3"].fillna(expr = "avg_victory_team1_1_3")
all_matchs["avg_draw_same_tournament_team1_1_5"].fillna(expr = "avg_draw_team1_1_5")
all_matchs["avg_victory_same_tournament_team2_1_10"].fillna(expr = "avg_victory_team2_1_10")
all_matchs["avg_victory_same_tournament_team2_1_3"].fillna(expr = "avg_victory_team2_1_3")
all_matchs["avg_draw_same_tournament_team2_1_5"].fillna(expr = "avg_draw_team2_1_5")
📅 dateDate | Abc tournamentVarchar(50) | 123 neutralInt | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Real | 123 avg_victory_same_tournament_team1_1_3Real | 123 avg_draw_same_tournament_team1_1_5Real | 123 avg_victory_same_tournament_team2_1_10Real | 123 avg_victory_same_tournament_team2_1_3Real | 123 avg_draw_same_tournament_team2_1_5Real | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | 123 avg_victory_rank2_team1_1_5Double | 123 avg_draw_rank2_team1_1_5Double | 123 avg_victory_rank1_team2_1_5Double | 123 avg_draw_rank1_team2_1_5Double | 123 avg_victory_rank1_rank2_team1_1_5Double | 123 avg_draw_rank1_rank2_team1_1_5Double | Abc resultVarchar(1) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1911-10-29 | Friendly | 0 | Luxembourg | Luxembourg | France | 4 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.1 | 0.0 | 0.2 | [null] | [null] | [null] | 0.1 | 0.0 | 0.2 | [null] | 0.3333333333333333 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 1 |
| 2 | 1913-04-20 | Friendly | 0 | France | Saint-Ouen | France | 8 | Luxembourg | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 3 | 1914-02-08 | Friendly | 0 | Luxembourg | Luxembourg | France | 4 | Luxembourg | 5 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0 | 0 | 1 | 0.7 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.7 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 2 |
| 4 | 1927-05-21 | Friendly | 0 | Luxembourg | Esch-sur-Alzette | England | 5 | Luxembourg | 2 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.6666666666666666 | 0.4 | 0.2 | 0.3333333333333333 | 0.2 | 0.9 | 1.0 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | [null] | [null] | 0.3333333333333333 | 0.0 | 0.6666666666666666 | 0.0 | 1 |
| 5 | 1934-03-11 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | Germany | 9 | Luxembourg | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.5 | 1.0 | 0.2 | 0.14285714285714285 | 0.0 | 0.4 | 0.5 | 0.3333333333333333 | 0.2 | 0.14285714285714285 | 0.3333333333333333 | 0.4 | 0.75 | 0.75 | 0.0 | [null] | [null] | 0.25 | 0.0 | 0.75 | 0.0 | 1 |
| 6 | 1934-04-15 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | France | 6 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.0 | 0.125 | 0.0 | 0.4 | 0.3 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | 0.6666666666666666 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 7 | 1935-08-18 | Friendly | 0 | Luxembourg | Luxembourg | Germany | 1 | Luxembourg | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.4 | 0.7 | 0.3333333333333333 | 0.2 | 0.14285714285714285 | 0.0 | 0.4 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 8 | 1936-09-27 | Friendly | 0 | Germany | Krefeld | Germany | 7 | Luxembourg | 2 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.1 | 0.0 | 0.2 | 0.7 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.4 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 9 | 1937-03-21 | Friendly | 0 | Luxembourg | Luxembourg | Germany | 3 | Luxembourg | 2 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.0 | 0.4 | 0.1 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.2 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 10 | 1938-03-20 | Friendly | 0 | Germany | Wuppertal | Germany | 2 | Luxembourg | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.9 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 0.7 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 11 | 1939-03-26 | Friendly | 0 | Luxembourg | Differdange | Germany | 1 | Luxembourg | 2 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0 | 0 | 1 | 0.5 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 2 |
| 12 | 1951-12-23 | Friendly | 0 | Germany | Essen | Germany | 4 | Luxembourg | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 | 0.7 | 0.6666666666666666 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 13 | 1952-04-20 | Friendly | 0 | Luxembourg | Luxembourg | Germany | 3 | Luxembourg | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.8 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.8 | 0.6666666666666666 | 0.0 | 0.3 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 14 | 1953-09-20 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | France | 6 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.6 | 0.3333333333333333 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | 0.25 | 0.0 | 0.5 | 0.0 | 0.0 | 0.0 | 0.75 | 0.6666666666666666 | 0.0 | 0.75 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 15 | 1953-12-17 | FIFA World Cup qualification | 0 | France | Paris | France | 8 | Luxembourg | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.5 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 0.5714285714285714 | 1.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 16 | 1954-03-28 | FIFA World Cup qualification | 0 | Saarland | Saarbrücken | Germany | 3 | Saarland | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.8 | 0.0 | 0.0 | 1.0 | 0.8333333333333334 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 1.0 | 0.8 | 0.8 | 0.0 | 0.8 | 0.0 | [null] | [null] | 0.8 | 0.0 | 1 |
| 17 | 1954-06-05 | Friendly | 0 | Saarland | Saarbrücken | Uruguay | 7 | Saarland | 1 | 2 | 1 | 5 | 1.5756853396901074 | 0.24553039332538737 | 0.4452555 | 0.4098360655737705 | 0.3007246376811594 | 0.5060240963855421 | CONMEBOL | 0.5 | 1.264600715137068 | 1.0 | 0.8 | 0.4302741358760429 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.0 | 0.4 | 0.0 | 0.0 | 0.5 | 0.2 | 0.0 | 0.4 | 0.0 | 0.3333333333333333 | 0.5 | 1.0 | 1.0 | 0.0 | [null] | [null] | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 18 | 1957-03-10 | Friendly | 0 | German DR | Berlin | Germany | 3 | Luxembourg | 0 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.5 | 0.6666666666666666 | 0.0 | 0.1 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 1.0 | 0.0 | 1 |
| 19 | 1960-10-19 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | England | 9 | Luxembourg | 0 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 0.9 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 20 | 1961-09-28 | FIFA World Cup qualification | 0 | England | London | England | 4 | Luxembourg | 1 | 1 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
Let’s export the result to our VAST DataBase using the variable match_sample to avoid counting the same game twice.
vo.drop("football_train", method = "view")
all_matchs.to_db(
name = "football_train",
relation_type = "view",
db_filter = (fun.year(all_matchs["date"]) <= 2015) & (fun.year(all_matchs["date"]) > 1980) & (all_matchs["match_sample"] == 1),
)
vo.drop("football_test", method = "view")
all_matchs.to_db(
name = "football_test",
relation_type = "view",
db_filter = (fun.year(all_matchs["date"]) > 2015) & (all_matchs["match_sample"] == 1),
)
📅 dateDate | Abc tournamentVarchar(50) | 123 neutralInt | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_World_Cup_1Bigint | 123 fifa_rank_1Integer | 123 Avg_goals_1Double | 123 Percent_Draw_1Double | 123 Number_Games_World_Tournament_1Decimal(28,7) | 123 Percent_Victory_World_Tournament_1Double | 123 Percent_Victory_Away_1Double | 123 Percent_Victory_Continental_Tournament_1Double | Abc confederation_1Varchar(8) | 123 Percent_Victory_Home_1Double | 123 Avg_goals_conceded_1Double | 123 Number_Games_Continental_Tournament_1Decimal(28,7) | 123 nb_Continental_Cup_1Decimal(27,6) | 123 Percent_Victory_1Double | 123 nb_World_Cup_2Bigint | ... | 123 victory_team1Int | 123 drawInt | 123 victory_team2Int | 123 avg_victory_team1_1_10Double | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Real | 123 avg_victory_same_tournament_team1_1_3Real | 123 avg_draw_same_tournament_team1_1_5Real | 123 avg_victory_same_tournament_team2_1_10Real | 123 avg_victory_same_tournament_team2_1_3Real | 123 avg_draw_same_tournament_team2_1_5Real | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | 123 avg_victory_rank2_team1_1_5Double | 123 avg_draw_rank2_team1_1_5Double | 123 avg_victory_rank1_team2_1_5Double | 123 avg_draw_rank1_team2_1_5Double | 123 avg_victory_rank1_rank2_team1_1_5Double | 123 avg_draw_rank1_rank2_team1_1_5Double | Abc resultVarchar(1) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1911-10-29 | Friendly | 0 | Luxembourg | Luxembourg | France | 4 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.1 | 0.0 | 0.2 | [null] | [null] | [null] | 0.1 | 0.0 | 0.2 | [null] | 0.3333333333333333 | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | [null] | 1 |
| 2 | 1913-04-20 | Friendly | 0 | France | Saint-Ouen | France | 8 | Luxembourg | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 0.6666666666666666 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 3 | 1914-02-08 | Friendly | 0 | Luxembourg | Luxembourg | France | 4 | Luxembourg | 5 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 0 | 0 | 1 | 0.7 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.7 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 2 |
| 4 | 1927-05-21 | Friendly | 0 | Luxembourg | Esch-sur-Alzette | England | 5 | Luxembourg | 2 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.6666666666666666 | 0.4 | 0.2 | 0.3333333333333333 | 0.2 | 0.9 | 1.0 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | [null] | [null] | 0.3333333333333333 | 0.0 | 0.6666666666666666 | 0.0 | 1 |
| 5 | 1934-03-11 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | Germany | 9 | Luxembourg | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.5 | 1.0 | 0.2 | 0.14285714285714285 | 0.0 | 0.4 | 0.5 | 0.3333333333333333 | 0.2 | 0.14285714285714285 | 0.3333333333333333 | 0.4 | 0.75 | 0.75 | 0.0 | [null] | [null] | 0.25 | 0.0 | 0.75 | 0.0 | 1 |
| 6 | 1934-04-15 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | France | 6 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.0 | 0.125 | 0.0 | 0.4 | 0.3 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | 0.6666666666666666 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 7 | 1935-08-18 | Friendly | 0 | Luxembourg | Luxembourg | Germany | 1 | Luxembourg | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.4 | 0.7 | 0.3333333333333333 | 0.2 | 0.14285714285714285 | 0.0 | 0.4 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 8 | 1936-09-27 | Friendly | 0 | Germany | Krefeld | Germany | 7 | Luxembourg | 2 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.1 | 0.0 | 0.2 | 0.7 | 0.3333333333333333 | 0.2 | 0.1111111111111111 | 0.0 | 0.4 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 9 | 1937-03-21 | Friendly | 0 | Luxembourg | Luxembourg | Germany | 3 | Luxembourg | 2 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.0 | 0.4 | 0.1 | 0.0 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.2 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 10 | 1938-03-20 | Friendly | 0 | Germany | Wuppertal | Germany | 2 | Luxembourg | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.9 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 0.7 | 0.3333333333333333 | 0.4 | 0.1 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 11 | 1939-03-26 | Friendly | 0 | Luxembourg | Differdange | Germany | 1 | Luxembourg | 2 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 0 | 0 | 1 | 0.5 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.6 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 2 |
| 12 | 1951-12-23 | Friendly | 0 | Germany | Essen | Germany | 4 | Luxembourg | 1 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 | 0.7 | 0.6666666666666666 | 0.0 | 0.4 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 13 | 1952-04-20 | Friendly | 0 | Luxembourg | Luxembourg | Germany | 3 | Luxembourg | 0 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.8 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.8 | 0.6666666666666666 | 0.0 | 0.3 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 14 | 1953-09-20 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | France | 6 | Luxembourg | 1 | 2 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.6 | 0.3333333333333333 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | 0.25 | 0.0 | 0.5 | 0.0 | 0.0 | 0.0 | 0.75 | 0.6666666666666666 | 0.0 | 0.75 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 15 | 1953-12-17 | FIFA World Cup qualification | 0 | France | Paris | France | 8 | Luxembourg | 0 | 1 | 1 | 5 | 1.758312020460358 | 0.21483375959079284 | 0.5036496 | 0.5362318840579711 | 0.36363636363636365 | 0.5488721804511278 | UEFA | 0.5321100917431193 | 1.3427109974424551 | 0.4006024 | 0.2 | 0.48081841432225064 | 0 | ... | 1 | 0 | 0 | 0.5 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 0.5714285714285714 | 1.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 0.8 | 0.0 | 1 |
| 16 | 1954-03-28 | FIFA World Cup qualification | 0 | Saarland | Saarbrücken | Germany | 3 | Saarland | 1 | 2 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.8 | 0.0 | 0.0 | 1.0 | 0.8333333333333334 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 1.0 | 0.8 | 0.8 | 0.0 | 0.8 | 0.0 | [null] | [null] | 0.8 | 0.0 | 1 |
| 17 | 1954-06-05 | Friendly | 0 | Saarland | Saarbrücken | Uruguay | 7 | Saarland | 1 | 2 | 1 | 5 | 1.5756853396901074 | 0.24553039332538737 | 0.4452555 | 0.4098360655737705 | 0.3007246376811594 | 0.5060240963855421 | CONMEBOL | 0.5 | 1.264600715137068 | 1.0 | 0.8 | 0.4302741358760429 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.0 | 0.4 | 0.0 | 0.0 | 0.5 | 0.2 | 0.0 | 0.4 | 0.0 | 0.3333333333333333 | 0.5 | 1.0 | 1.0 | 0.0 | [null] | [null] | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 18 | 1957-03-10 | Friendly | 0 | German DR | Berlin | Germany | 3 | Luxembourg | 0 | 1 | 4 | 5 | 2.0998322147651005 | 0.2080536912751678 | 0.8759124 | 0.6 | 0.4702127659574468 | 0.6242774566473989 | UEFA | 0.6083916083916084 | 1.179530201342282 | 0.5210843 | 0.3 | 0.5553691275167785 | 0 | ... | 1 | 0 | 0 | 0.4 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.0 | 0.5 | 0.6666666666666666 | 0.0 | 0.2 | 0.3333333333333333 | 0.4 | 0.8 | 0.6666666666666666 | 0.0 | 0.8 | 0.0 | 0.2 | 0.0 | 1.0 | 0.0 | 1 |
| 19 | 1960-10-19 | FIFA World Cup qualification | 0 | Luxembourg | Luxembourg | England | 9 | Luxembourg | 0 | 2 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 1 | 0 | 0 | 0.3 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 0.9 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
| 20 | 1961-09-28 | FIFA World Cup qualification | 0 | England | London | England | 4 | Luxembourg | 1 | 1 | 1 | 5 | 2.19937369519833 | 0.24112734864300625 | 0.4525547 | 0.41935483870967744 | 0.5308641975308642 | 0.5968992248062015 | UEFA | 0.6187845303867403 | 0.9926931106471816 | 0.3885542 | 0.0 | 0.5657620041753654 | 0 | ... | 1 | 0 | 0 | 0.7 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.8 | 0.3333333333333333 | 0.4 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1 |
Machine Learning¶
It’s time to make predictions about the outcomes of games. We have a lot of variables, so we need trees deep enough to pick up the most important features. We also need to consider a minimum number of games in each leaf to avoid over-fitting.
predictors = all_matchs.get_columns(
exclude_columns = [
"match_sample",
"team2_score",
"team1_score",
"date",
"city",
"country",
"result",
"victory_team1",
"victory_team2",
"draw",
"tournament",
"team1",
"team2",
"confederation_1",
"confederation_2",
],
)
from vastorbit.machine_learning.vast import RandomForestClassifier
model = RandomForestClassifier(
n_estimators = 4,
max_depth = 3,
)
model.fit(
"football_train",
predictors,
"result",
"football_test",
)
model.classification_report()
| 1 | 2 | X | avg_macro | avg_weighted | avg_micro | |
|---|---|---|---|---|---|---|
| auc | 0.6271499375481677 | 0.7142270975431444 | 0 | 0.4471256783637707 | 0.5013063070834367 | [null] |
| prc_auc | 0.6293187232280789 | 0.5343307662858413 | 0.6195932028836251 | 0.5944142307991818 | 0.5999759085176515 | [null] |
| accuracy | 0.6514992109416097 | 0.7117306680694372 | 0.759863229879011 | 0.7076977029633525 | 0.6946466476709703 | 0.7076977029633527 |
| log_loss | 33.158074422223756 | 20.947486706798067 | 49.567234712984636 | 34.55759861400215 | 33.62675354507739 | [null] |
| precision | 0.5971049457177322 | 0.49429657794676807 | 0.0 | 0.36380050788816676 | 0.4244872021615245 | 0.5615465544450289 |
| recall | 0.8213495575221239 | 0.6012950971322849 | 0.0 | 0.47421488488480296 | 0.5615465544450289 | 0.5615465544450289 |
| f1_score | 0.6915017462165308 | 0.5425709515859767 | 0.0 | 0.4113575659341692 | 0.4831021451404336 | 0.5615465544450289 |
| mcc | 0.3347623387328022 | 0.3384717883764017 | 0.0 | 0.224411375703068 | 0.2554282776601253 | 0.3423198316675434 |
| informedness | 0.31884203495442076 | 0.35689965428039216 | 0.0 | 0.22524722974493763 | 0.25309703458040417 | 0.3423198316675433 |
| markedness | 0.3514775692918768 | 0.32099541188323766 | -0.240136770120989 | 0.14411207035137516 | 0.20074240252630984 | 0.3423198316675433 |
| csi | 0.5284697508896797 | 0.3722794959908362 | 0.0 | 0.300249748960172 | 0.35715608752620587 | 0.39038215395867615 |
Our model is excellent! 57% of accuracy on 3 categories - it’s almost twice as good as a random model.
model.score(metric = "accuracy")
Looking at the importance of each feature, it seems like direct confrontations and victories against teams of another rank seem to be the strongest indicators of a team’s success.
model.features_importance()
Let’s add the predictions to the VastFrame.
Draws are pretty rare, so we’ll only consider them if a tie was very likely to occur.
test = vo.VastFrame("football_test")
model.predict_proba(test, name = "prob_1", pos_label = "1")
model.predict_proba(test, name = "prob_X", pos_label = "X")
model.predict_proba(test, name = "prob_2", pos_label = "2")
# Materialize the probabilities so the decision rule below compares stored
# columns instead of re-deriving the forest SQL for every reference.
vo.drop("football_pred", method = "table")
test.to_db(name = "football_pred", relation_type = "table")
test = vo.VastFrame("football_pred")
test.case_when(
"prediction",
test["prob_1"] > test["prob_2"] + 0.05, "1",
test["prob_2"] > test["prob_1"] + 0.05, "2",
(test["prob_X"] > test["prob_1"]) & (test["prob_X"] > test["prob_2"]), "X",
fun.abs(test["prob_1"] - test["prob_2"]) < 0.03, "X",
test["prob_1"] > test["prob_2"], "1",
test["prob_1"] < test["prob_2"], "2",
)
📅 dateDate | Abc tournamentVarchar(50) | 123 neutralInteger | Abc countryVarchar(50) | Abc cityVarchar(50) | Abc team1Varchar(50) | 123 team1_scoreInteger | Abc team2Varchar(50) | 123 team2_scoreInteger | 123 match_sampleInteger | 123 nb_world_cup_1Bigint | 123 fifa_rank_1Integer | 123 avg_goals_1Double | 123 percent_draw_1Double | 123 number_games_world_tournament_1Decimal(28,7) | 123 percent_victory_world_tournament_1Double | 123 percent_victory_away_1Double | 123 percent_victory_continental_tournament_1Double | Abc confederation_1Varchar(8) | 123 percent_victory_home_1Double | 123 avg_goals_conceded_1Double | 123 number_games_continental_tournament_1Decimal(28,7) | 123 nb_continental_cup_1Decimal(27,6) | 123 percent_victory_1Double | 123 nb_world_cup_2Bigint | ... | 123 avg_victory_team1_1_3Double | 123 avg_draw_team1_1_5Double | 123 avg_victory_team2_1_10Double | 123 avg_victory_team2_1_3Double | 123 avg_draw_team2_1_5Double | 123 avg_victory_same_tournament_team1_1_10Double | 123 avg_victory_same_tournament_team1_1_3Double | 123 avg_draw_same_tournament_team1_1_5Double | 123 avg_victory_same_tournament_team2_1_10Double | 123 avg_victory_same_tournament_team2_1_3Double | 123 avg_draw_same_tournament_team2_1_5Double | 123 avg_victory_direct_team1_1_5Double | 123 avg_victory_direct_team1_1_3Double | 123 avg_draw_direct_team1_1_5Double | 123 avg_victory_rank2_team1_1_5Double | 123 avg_draw_rank2_team1_1_5Double | 123 avg_victory_rank1_team2_1_5Double | 123 avg_draw_rank1_team2_1_5Double | 123 avg_victory_rank1_rank2_team1_1_5Double | 123 avg_draw_rank1_rank2_team1_1_5Double | Abc resultVarchar(1) | 123 prob_1Decimal(16,12) | 123 prob_xDecimal(16,12) | 123 prob_2Decimal(16,12) | Abc predictionVarchar(1) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2016-03-23 | CFU Caribbean Cup qualification | 0 | Martinique | Fort-de-France | Martinique | 3 | British Virgin Islands | 0 | 1 | 0 | 1 | 1.8664259927797835 | 0.259927797833935 | 0.0 | 0.0 | 0.4260355029585799 | 0.18181818181818182 | CONCACAF | 0.5463917525773195 | 1.2743682310469313 | 0.0331325 | 0.0 | 0.4584837545126354 | 0 | ... | 0.6666666666666666 | 0.4 | 0.1 | 0.0 | 0.2 | 0.4 | 0.0 | 0.8 | 0.0 | 0.0 | 0.0 | 0.6666666666666666 | 0.6666666666666666 | 0.3333333333333333 | 1.0 | 0.0 | 0.0 | 0.2 | 0.2 | 0.4 | 1 | 1.0 | 1.0 | 1.0 | X |
| 2 | 2016-03-26 | CFU Caribbean Cup qualification | 0 | British Virgin Islands | Road Town | British Virgin Islands | 0 | Dominica | 7 | 1 | 0 | 1 | 0.8765432098765432 | 0.16049382716049382 | 0.0 | 0.0 | 0.16 | 0.0 | OFC | 0.36363636363636365 | 3.111111111111111 | 0.0271084 | 0.0 | 0.19753086419753085 | 0 | ... | 0.0 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.2 | 0.0 | 0.2 | 0.0 | 0.0 | 0.2 | 0.0 | 0.2 | 0.4 | 0.2 | 0.4 | 0.2 | 2 | 0.0 | 0.0 | 0.0 | X |
| 3 | 2016-03-29 | CFU Caribbean Cup qualification | 0 | Dominica | Roseau | Dominica | 1 | Martinique | 4 | 1 | 0 | 1 | 1.1393939393939394 | 0.20606060606060606 | 0.0 | 0.0 | 0.1574074074074074 | 0.11764705882352941 | OFC | 0.475 | 2.090909090909091 | 0.0512048 | 0.0 | 0.23030303030303031 | 0 | ... | 0.6666666666666666 | 0.2 | 0.5 | 0.6666666666666666 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | 0.5 | 0.3333333333333333 | 0.6 | 0.0 | 0.0 | 0.0 | 0.4 | 0.2 | 1.0 | 0.0 | 0.6 | 0.0 | 2 | 0.25 | 0.25 | 0.25 | X |
| 4 | 2016-05-27 | Friendly | 0 | France | Ajaccio | Corsica | 1 | Basque Country | 1 | 1 | 0 | 1 | 0.8 | 0.4 | 0.0 | 0.0 | 0.0 | 0.0 | OFC | 0.4 | 0.6 | 0.0 | 0.0 | 0.4 | 0 | ... | 0.6666666666666666 | 0.4 | 0.7 | 0.6666666666666666 | 0.2 | 0.4 | 0.6666666666666666 | 0.4 | 0.7 | 0.6666666666666666 | 0.2 | 0.6 | 0.6 | 0.0 | [null] | [null] | 0.2 | 0.6 | 0.6 | 0.0 | X | 0.75 | 0.75 | 0.75 | X |
| 5 | 2016-05-29 | CONIFA World Football Cup | 1 | Georgia | Gagra | Padania | 1 | Northern Cyprus | 2 | 1 | 0 | 1 | 2.5 | 0.125 | 0.0 | 0.0 | 0.8333333333333334 | 0.0 | OFC | 1.0 | 0.5625 | 0.0 | 0.0 | 0.875 | 0 | ... | 0.6666666666666666 | 0.4 | 0.6 | 0.3333333333333333 | 0.0 | 0.3333333333333333 | 0.3333333333333333 | 0.6666666666666666 | 0.6 | 0.3333333333333333 | 0.0 | 0.8 | 0.8 | 0.2 | 0.8 | 0.2 | 0.5 | 0.0 | 0.4 | 0.4 | 2 | 0.75 | 0.75 | 0.75 | X |
| 6 | 2016-06-02 | CONIFA World Football Cup | 1 | Georgia | Suhkumi | Iraqi Kurdistan | 2 | Padania | 2 | 1 | 0 | 1 | 2.1 | 0.25 | 0.0 | 0.0 | 0.35294117647058826 | 0.0 | OFC | 1.0 | 1.15 | 0.0 | 0.0 | 0.45 | 0 | ... | 0.6666666666666666 | 0.6 | 0.7 | 0.6666666666666666 | 0.4 | 0.42857142857142855 | 0.6666666666666666 | 0.6 | 0.25 | 0.0 | 0.5 | 0.0 | 0.0 | 0.2 | 0.2 | 0.2 | 0.6 | 0.2 | 0.2 | 0.6 | X | 0.0 | 0.0 | 0.0 | X |
| 7 | 2016-06-05 | CONIFA World Football Cup | 1 | Georgia | Suhkumi | Padania | 0 | Northern Cyprus | 2 | 1 | 0 | 1 | 2.5 | 0.125 | 0.0 | 0.0 | 0.8333333333333334 | 0.0 | OFC | 1.0 | 0.5625 | 0.0 | 0.0 | 0.875 | 0 | ... | 0.3333333333333333 | 0.2 | 0.5 | 0.3333333333333333 | 0.2 | 0.3333333333333333 | 0.3333333333333333 | 0.6 | 0.5 | 0.3333333333333333 | 0.25 | 0.0 | 0.0 | 0.0 | 0.4 | 0.4 | 0.6666666666666666 | 0.0 | 0.4 | 0.4 | 2 | 0.25 | 0.25 | 0.25 | X |
| 8 | 2016-07-02 | EAFF Championship | 1 | Guam | Dededo | Mongolia | 0 | Chinese Taipei | 2 | 1 | 0 | 1 | 1.0888888888888888 | 0.08888888888888889 | 0.0 | 0.0 | 0.2413793103448276 | 0.21428571428571427 | OFC | 1.0 | 3.2222222222222223 | 0.0421687 | 0.0 | 0.26666666666666666 | 0 | ... | 0.6666666666666666 | 0.2 | 0.2 | 0.0 | 0.0 | 0.4 | 0.0 | 0.2 | 0.42857142857142855 | 0.0 | 0.2 | 0.4 | 0.4 | 0.2 | 0.4 | 0.2 | 0.6 | 0.4 | 0.2 | 0.4 | 2 | 0.75 | 0.75 | 0.75 | X |
| 9 | 2016-10-21 | AFF Championship | 1 | Cambodia | Phnom Penh | Laos | 4 | Brunei | 3 | 1 | 0 | 1 | 1.0229007633587786 | 0.15267175572519084 | 0.0 | 0.0 | 0.17391304347826086 | 0.08 | AFC | 0.42857142857142855 | 3.3587786259541983 | 0.0753012 | 0.0 | 0.183206106870229 | 0 | ... | 0.3333333333333333 | 0.2 | 0.2 | 0.3333333333333333 | 0.0 | 0.4 | 0.3333333333333333 | 0.0 | 0.3 | 0.3333333333333333 | 0.0 | 1.0 | 1.0 | 0.0 | 0.6 | 0.4 | 0.0 | 0.0 | 0.4 | 0.0 | 1 | 1.0 | 1.0 | 1.0 | X |
| 10 | 2016-11-09 | AFC Challenge Cup | 1 | Malaysia | Kuching | Mongolia | 0 | Laos | 3 | 1 | 0 | 1 | 1.0888888888888888 | 0.08888888888888889 | 0.0 | 0.0 | 0.2413793103448276 | 0.21428571428571427 | OFC | 1.0 | 3.2222222222222223 | 0.0421687 | 0.0 | 0.26666666666666666 | 0 | ... | 0.6666666666666666 | 0.2 | 0.3 | 0.6666666666666666 | 0.0 | 0.5 | 0.5 | 0.0 | 0.2 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.5 | 0.2 | 0.2 | 0.6 | 0.4 | 0.6 | 0.0 | 2 | 0.5 | 0.5 | 0.5 | X |
| 11 | 2016-11-14 | AFC Challenge Cup | 1 | Malaysia | Kuching | Laos | 3 | Brunei | 2 | 1 | 0 | 1 | 1.0229007633587786 | 0.15267175572519084 | 0.0 | 0.0 | 0.17391304347826086 | 0.08 | AFC | 0.42857142857142855 | 3.3587786259541983 | 0.0753012 | 0.0 | 0.183206106870229 | 0 | ... | 0.3333333333333333 | 0.2 | 0.2 | 0.3333333333333333 | 0.2 | 0.2857142857142857 | 0.3333333333333333 | 0.4 | 0.3333333333333333 | 0.3333333333333333 | 0.4 | 1.0 | 1.0 | 0.0 | 0.8 | 0.2 | 0.0 | 0.0 | 0.4 | 0.0 | 1 | 1.0 | 1.0 | 1.0 | X |
| 12 | 2017-04-22 | African Nations Championship | 0 | Mauritius | Belle Vue Maurel | Mauritius | 2 | Seychelles | 1 | 1 | 0 | 1 | 1.3286384976525822 | 0.2112676056338028 | 0.0 | 0.0 | 0.2903225806451613 | 0.047619047619047616 | CAF | 0.35294117647058826 | 1.699530516431925 | 0.063253 | 0.0 | 0.2863849765258216 | 0 | ... | 0.0 | 0.2 | 0.1 | 0.0 | 0.0 | 0.2 | 0.0 | 0.2 | 0.0 | 0.0 | 0.0 | 0.4 | 0.6666666666666666 | 0.2 | 0.4 | 0.2 | 0.4 | 0.2 | 0.4 | 0.0 | 1 | 0.75 | 0.75 | 0.75 | X |
| 13 | 2017-04-29 | African Nations Championship | 0 | Seychelles | Victoria | Seychelles | 1 | Mauritius | 1 | 1 | 0 | 1 | 0.7294117647058823 | 0.1411764705882353 | 0.0 | 0.0 | 0.0425531914893617 | 0.0 | CAF | 0.4166666666666667 | 2.0588235294117645 | 0.0421687 | 0.0 | 0.1411764705882353 | 0 | ... | 0.0 | 0.0 | 0.3 | 0.3333333333333333 | 0.2 | 0.0 | 0.0 | 0.0 | 0.3333333333333333 | 0.3333333333333333 | 0.2 | 0.2 | 0.0 | 0.2 | 0.2 | 0.2 | 0.6 | 0.2 | 0.4 | 0.2 | X | 0.0 | 0.0 | 0.0 | X |
| 14 | 2017-06-10 | CONIFA European Football Cup | 0 | Northern Cyprus | Nicosia | Northern Cyprus | 1 | Padania | 1 | 1 | 0 | 1 | 2.2666666666666666 | 0.06666666666666667 | 0.0 | 0.0 | 0.4 | 0.0 | OFC | 0.8 | 1.2 | 0.0 | 0.0 | 0.5333333333333333 | 0 | ... | 0.6666666666666666 | 0.2 | 0.5 | 0.3333333333333333 | 0.4 | 0.6666666666666666 | 0.6666666666666666 | 0.3333333333333333 | 0.6666666666666666 | 0.3333333333333333 | 0.4 | 1.0 | 1.0 | 0.0 | 0.75 | 0.0 | 0.2 | 0.4 | 0.2 | 0.6 | X | 0.75 | 0.75 | 0.75 | X |
| 15 | 2017-06-25 | Island Games | 1 | Sweden | Dalhem | Guernsey | 1 | Åland Islands | 1 | 1 | 0 | 1 | 2.1492537313432836 | 0.22388059701492538 | 0.0 | 0.0 | 0.4716981132075472 | 0.0 | OFC | 0.5 | 1.2686567164179106 | 0.0 | 0.0 | 0.47761194029850745 | 0 | ... | 1.0 | 0.0 | 0.3 | 0.0 | 0.2 | 0.9 | 1.0 | 0.0 | 0.3 | 0.0 | 0.2 | 0.3333333333333333 | 0.3333333333333333 | 0.3333333333333333 | 0.8 | 0.0 | 0.2 | 0.2 | 0.2 | 0.8 | X | 0.75 | 0.75 | 0.75 | X |
| 16 | 2017-06-26 | Island Games | 1 | Sweden | Stenkyrka | Shetland | 0 | Guernsey | 3 | 1 | 0 | 1 | 1.627906976744186 | 0.16279069767441862 | 0.0 | 0.0 | 0.34210526315789475 | 0.0 | OFC | 0.6 | 1.8604651162790697 | 0.0 | 0.0 | 0.37209302325581395 | 0 | ... | 0.3333333333333333 | 0.0 | 0.8 | 0.6666666666666666 | 0.2 | 0.4 | 0.3333333333333333 | 0.0 | 0.8 | 0.6666666666666666 | 0.2 | 0.6666666666666666 | 0.6666666666666666 | 0.0 | 0.4 | 0.2 | 0.6 | 0.2 | 0.0 | 1.0 | 2 | 0.75 | 0.75 | 0.75 | X |
| 17 | 2017-06-27 | Island Games | 1 | Sweden | Visby | Åland Islands | 2 | Shetland | 1 | 1 | 0 | 1 | 1.619047619047619 | 0.09523809523809523 | 0.0 | 0.0 | 0.42424242424242425 | 0.0 | OFC | 0.5555555555555556 | 1.7380952380952381 | 0.0 | 0.0 | 0.4523809523809524 | 0 | ... | 0.0 | 0.6 | 0.4 | 0.3333333333333333 | 0.0 | 0.2 | 0.0 | 0.6 | 0.4 | 0.3333333333333333 | 0.0 | 0.75 | 0.6666666666666666 | 0.0 | 0.0 | 0.4 | 0.4 | 0.2 | 0.2 | 0.6 | 1 | 0.5 | 0.5 | 0.5 | X |
| 18 | 2017-06-29 | Island Games | 0 | Sweden | Visby | Gotland | 2 | Jersey | 3 | 1 | 0 | 1 | 2.4615384615384617 | 0.15384615384615385 | 0.0 | 0.0 | 0.2857142857142857 | 0.0 | OFC | 0.6 | 2.0 | 0.0 | 0.0 | 0.34615384615384615 | 0 | ... | 0.6666666666666666 | 0.0 | 0.7 | 0.6666666666666666 | 0.2 | 0.3 | 0.6666666666666666 | 0.0 | 0.7 | 0.6666666666666666 | 0.2 | 0.0 | 0.0 | 0.5 | 0.0 | 0.2 | 0.8 | 0.0 | 0.6 | 0.0 | 2 | 0.0 | 0.0 | 0.0 | X |
| 19 | 2017-07-08 | Gold Cup | 1 | United States | Nashville | Martinique | 2 | Nicaragua | 0 | 1 | 0 | 1 | 1.8664259927797835 | 0.259927797833935 | 0.0 | 0.0 | 0.4260355029585799 | 0.18181818181818182 | CONCACAF | 0.5463917525773195 | 1.2743682310469313 | 0.0331325 | 0.0 | 0.4584837545126354 | 0 | ... | 0.3333333333333333 | 0.2 | 0.2 | 0.0 | 0.2 | 0.2 | 0.3333333333333333 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.6 | 0.0 | 1 | 1.0 | 1.0 | 1.0 | X |
| 20 | 2017-10-05 | Friendly | 0 | Chinese Taipei | Taipei | Chinese Taipei | 4 | Mongolia | 2 | 1 | 0 | 1 | 1.3189655172413792 | 0.15517241379310345 | 0.0 | 0.0 | 0.25316455696202533 | 0.11428571428571428 | AFC | 0.5 | 2.853448275862069 | 0.1054217 | 0.0 | 0.21551724137931033 | 0 | ... | 0.3333333333333333 | 0.2 | 0.4 | 0.3333333333333333 | 0.0 | 0.1 | 0.0 | 0.2 | 0.0 | 0.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.6 | 0.4 | 0.0 | 0.2 | 0.4 | 0.0 | 1 | 1.0 | 1.0 | 1.0 | X |
Let’s look at our predictions for the 2018 World Cup.
test.search(
conditions = [test["tournament"] == 'FIFA World Cup'],
usecols = [
"date",
"team1",
"result",
"prediction",
"team2",
"prob_1",
"prob_X",
"prob_2",
],
order_by = ["date"],
).head(128)
📅 dateDate | Abc team1Varchar(50) | Abc resultVarchar(1) | Abc predictionVarchar(1) | Abc team2Varchar(50) | 123 prob_1Decimal(16,12) | 123 prob_xDecimal(16,12) | 123 prob_2Decimal(16,12) | |
|---|---|---|---|---|---|---|---|---|
| 1 | 2018-06-14 | Russia | 1 | X | Saudi Arabia | 0.75 | 0.75 | 0.75 |
| 2 | 2018-06-15 | Morocco | 2 | X | Iran | 0.5 | 0.5 | 0.5 |
| 3 | 2018-06-15 | Portugal | X | X | Spain | 0.75 | 0.75 | 0.75 |
| 4 | 2018-06-15 | Egypt | 2 | X | Uruguay | 0.75 | 0.75 | 0.75 |
| 5 | 2018-06-16 | Croatia | 1 | X | Nigeria | 1.0 | 1.0 | 1.0 |
| 6 | 2018-06-16 | Peru | 2 | X | Denmark | 1.0 | 1.0 | 1.0 |
| 7 | 2018-06-16 | Argentina | X | X | Iceland | 1.0 | 1.0 | 1.0 |
| 8 | 2018-06-16 | France | 1 | X | Australia | 1.0 | 1.0 | 1.0 |
| 9 | 2018-06-17 | Brazil | X | X | Switzerland | 1.0 | 1.0 | 1.0 |
| 10 | 2018-06-17 | Costa Rica | 2 | X | Serbia | 0.75 | 0.75 | 0.75 |
| 11 | 2018-06-17 | Germany | 2 | X | Mexico | 1.0 | 1.0 | 1.0 |
| 12 | 2018-06-18 | Sweden | 1 | X | South Korea | 0.5 | 0.5 | 0.5 |
| 13 | 2018-06-18 | Tunisia | 2 | X | England | 0.25 | 0.25 | 0.25 |
| 14 | 2018-06-18 | Belgium | 1 | X | Panama | 1.0 | 1.0 | 1.0 |
| 15 | 2018-06-19 | Poland | 2 | X | Senegal | 1.0 | 1.0 | 1.0 |
| 16 | 2018-06-19 | Russia | 1 | X | Egypt | 1.0 | 1.0 | 1.0 |
| 17 | 2018-06-19 | Colombia | 2 | X | Japan | 0.75 | 0.75 | 0.75 |
| 18 | 2018-06-20 | Iran | 2 | X | Spain | 0.5 | 0.5 | 0.5 |
| 19 | 2018-06-20 | Portugal | 1 | X | Morocco | 0.75 | 0.75 | 0.75 |
| 20 | 2018-06-20 | Uruguay | 1 | X | Saudi Arabia | 1.0 | 1.0 | 1.0 |
| 21 | 2018-06-21 | France | 1 | X | Peru | 1.0 | 1.0 | 1.0 |
| 22 | 2018-06-21 | Denmark | X | X | Australia | 1.0 | 1.0 | 1.0 |
| 23 | 2018-06-21 | Argentina | 2 | X | Croatia | 0.75 | 0.75 | 0.75 |
| 24 | 2018-06-22 | Serbia | 2 | X | Switzerland | 1.0 | 1.0 | 1.0 |
| 25 | 2018-06-22 | Brazil | 1 | X | Costa Rica | 1.0 | 1.0 | 1.0 |
| 26 | 2018-06-22 | Nigeria | 1 | X | Iceland | 1.0 | 1.0 | 1.0 |
| 27 | 2018-06-23 | Belgium | 1 | X | Tunisia | 1.0 | 1.0 | 1.0 |
| 28 | 2018-06-23 | Germany | 1 | X | Sweden | 0.75 | 0.75 | 0.75 |
| 29 | 2018-06-23 | South Korea | 2 | X | Mexico | 1.0 | 1.0 | 1.0 |
| 30 | 2018-06-24 | Poland | 2 | X | Colombia | 0.75 | 0.75 | 0.75 |
| 31 | 2018-06-24 | Japan | X | X | Senegal | 1.0 | 1.0 | 1.0 |
| 32 | 2018-06-24 | England | 1 | X | Panama | 1.0 | 1.0 | 1.0 |
| 33 | 2018-06-25 | Russia | 2 | X | Uruguay | 0.75 | 0.75 | 0.75 |
| 34 | 2018-06-25 | Saudi Arabia | 1 | X | Egypt | 0.75 | 0.75 | 0.75 |
| 35 | 2018-06-25 | Iran | X | X | Portugal | 0.75 | 0.75 | 0.75 |
| 36 | 2018-06-25 | Spain | X | X | Morocco | 1.0 | 1.0 | 1.0 |
| 37 | 2018-06-26 | Iceland | 2 | X | Croatia | 0.25 | 0.25 | 0.25 |
| 38 | 2018-06-26 | Australia | 2 | X | Peru | 1.0 | 1.0 | 1.0 |
| 39 | 2018-06-26 | Denmark | X | X | France | 0.5 | 0.5 | 0.5 |
| 40 | 2018-06-26 | Nigeria | 2 | X | Argentina | 0.5 | 0.5 | 0.5 |
| 41 | 2018-06-27 | Serbia | 2 | X | Brazil | 0.25 | 0.25 | 0.25 |
| 42 | 2018-06-27 | South Korea | 1 | X | Germany | 0.5 | 0.5 | 0.5 |
| 43 | 2018-06-27 | Switzerland | X | X | Costa Rica | 1.0 | 1.0 | 1.0 |
| 44 | 2018-06-27 | Mexico | 2 | X | Sweden | 1.0 | 1.0 | 1.0 |
| 45 | 2018-06-28 | Japan | 2 | X | Poland | 1.0 | 1.0 | 1.0 |
| 46 | 2018-06-28 | Senegal | 2 | X | Colombia | 0.5 | 0.5 | 0.5 |
| 47 | 2018-06-28 | Panama | 2 | X | Tunisia | 0.75 | 0.75 | 0.75 |
| 48 | 2018-06-28 | England | 2 | X | Belgium | 1.0 | 1.0 | 1.0 |
| 49 | 2018-06-30 | France | 1 | X | Argentina | 0.75 | 0.75 | 0.75 |
| 50 | 2018-06-30 | Uruguay | 1 | X | Portugal | 1.0 | 1.0 | 1.0 |
| 51 | 2018-07-01 | Russia | X | X | Spain | 0.5 | 0.5 | 0.5 |
| 52 | 2018-07-01 | Croatia | X | X | Denmark | 1.0 | 1.0 | 1.0 |
| 53 | 2018-07-02 | Belgium | 1 | X | Japan | 1.0 | 1.0 | 1.0 |
| 54 | 2018-07-02 | Brazil | 1 | X | Mexico | 1.0 | 1.0 | 1.0 |
| 55 | 2018-07-03 | Sweden | 1 | X | Switzerland | 1.0 | 1.0 | 1.0 |
| 56 | 2018-07-03 | Colombia | X | X | England | 0.25 | 0.25 | 0.25 |
| 57 | 2018-07-06 | Uruguay | 2 | X | France | 0.5 | 0.5 | 0.5 |
| 58 | 2018-07-06 | Brazil | 2 | X | Belgium | 1.0 | 1.0 | 1.0 |
| 59 | 2018-07-07 | Sweden | 2 | X | England | 0.75 | 0.75 | 0.75 |
| 60 | 2018-07-07 | Russia | X | X | Croatia | 0.75 | 0.75 | 0.75 |
| 61 | 2018-07-10 | France | 1 | X | Belgium | 0.75 | 0.75 | 0.75 |
| 62 | 2018-07-11 | Croatia | 1 | X | England | 0.75 | 0.75 | 0.75 |
| 63 | 2018-07-14 | Belgium | 1 | X | England | 0.75 | 0.75 | 0.75 |
| 64 | 2018-07-15 | France | 1 | X | Croatia | 0.75 | 0.75 | 0.75 |
Fantastic: we built a very efficient model which predicted that France will win almost all of its games (except the game against Argentina which is really hard to predict). In reality, France did indeed win the 2018 World Cup!
test.search(
conditions = [
test["tournament"] == 'FIFA World Cup',
(test["team1"] == 'France') | (test["team2"] == 'France'),
],
usecols = [
"date",
"team1",
"result",
"prediction",
"team2",
"prob_1",
"prob_X",
"prob_2",
],
order_by = ["date"],
).head(128)
📅 dateDate | Abc team1Varchar(50) | Abc resultVarchar(1) | Abc predictionVarchar(1) | Abc team2Varchar(50) | 123 prob_1Decimal(16,12) | 123 prob_xDecimal(16,12) | 123 prob_2Decimal(16,12) | |
|---|---|---|---|---|---|---|---|---|
| 1 | 2018-06-16 | France | 1 | X | Australia | 1.0 | 1.0 | 1.0 |
| 2 | 2018-06-21 | France | 1 | X | Peru | 1.0 | 1.0 | 1.0 |
| 3 | 2018-06-26 | Denmark | X | X | France | 0.5 | 0.5 | 0.5 |
| 4 | 2018-06-30 | France | 1 | X | Argentina | 0.75 | 0.75 | 0.75 |
| 5 | 2018-07-06 | Uruguay | 2 | X | France | 0.5 | 0.5 | 0.5 |
| 6 | 2018-07-10 | France | 1 | X | Belgium | 0.75 | 0.75 | 0.75 |
| 7 | 2018-07-15 | France | 1 | X | Croatia | 0.75 | 0.75 | 0.75 |
Conclusion¶
We’ve solved our problem in a pandas-like way, all without ever loading data into memory!