<jupyter_start><jupyter_text>I think we can reject the null hypothesis that home and away goals are equally as frequent.<jupyter_code>k_rnds = {'r16', 'quarters', 'semis'}
knockout = games[games.rnd.isin(k_rnds)]
knockout.shape
# Need to drop the 2020's final knockout matchups because they were 1 games knockouts due to Covid-19
knockout = knockout.dropna()
knockout.shape
# splitting on notes to get the legs
notes = knockout.notes.str.split(";", expand=True).rename({0: 'leg', 1: 'Note1', 2: 'Note2'}, axis=1)
knockout = pd.concat([knockout, notes], axis=1)
legs = knockout.groupby('leg')
legs.sum()
legs.mean()
m.columns
# Get all away goal matches
away = m[m.win_cond == 'away']
away.head()
away[['goalstotal_g1', 'goalstotal_g2']].describe()<jupyter_output><empty_output><jupyter_text>So the game 1 totals are slightly higher, but not by much.<jupyter_code>fig, axs = plt.subplots(1, 3, figsize=(15, 5))
sns.countplot(x='goalstotal_g1', data=away, ax=axs[0])
axs[0].set(xlabel='Total Goals For Game 1')
sns.countplot(x='goalstotal_g2', data=away, ax=axs[1])
axs[1].set(xlabel='Total Goals For Game 2')
sns.boxplot(data=away[['goalstotal_g1', 'goalstotal_g2']], ax=axs[2])
plt.show()<jupyter_output><empty_output><jupyter_text>Let's look at the whole dataset.<jupyter_code>m[['goalstotal_g1', 'goalstotal_g2']].describe()

m[['goalstotal_g1', 'goalstotal_g2']].median()
fig, axs = plt.subplots(1, 3, figsize=(15, 5))
sns.countplot(x='goalstotal_g1', data=m, ax=axs[0])
sns.countplot(x='goalstotal_g2', data=m, ax=axs[1])
sns.boxplot(data=m[['goalstotal_g1', 'goalstotal_g2']], ax=axs[2])
plt.show()
goal_diff = pd.DataFrame((away.goalstotal_g1 - away.goalstotal_g2), columns=['goal_diff'])
sns.countplot(x='goal_diff', data=goal_diff)
plt.show()
goal_diff = pd.DataFrame((m.goalstotal_g1 - m.goalstotal_g2), columns=['goal_diff'])
sns.countplot(x='goal_diff', data=goal_diff)
plt.show()
# Let's see what the chances of winner the first game and the 

m.columns

# conds = {
#     'g1w': m.game_winner_g1 == m.winner,
#     'g2w': m.game_winner_game2 == m.winner,
#     'g1w_g2w': (m.game_winner_g1 == m.winner) & (m.game_winner_game2 == m.winner),
#     'g1l_g2l': (m.game_winner_g1 == m.loser) & (m.game_winner_game2 == m.loser),
#     'g1w_g2l': (m.game_winner_g1 == m.winner) & (m.game_winner_game2 == m.loser),
#     'g1w_g2t': (m.game_winner_g1 == m.winner) & (m.game_winner_game2 == 'tie'),
#     'g1l_g2w': (m.game_winner_g1 == m.loser) & (m.game_winner_game2 == m.winner),
#     'g1t_g2w': (m.game_winner_g1 == 'tie') & (m.game_winner_game2 == m.winner),
# }
# for k, v in conds.items():
#     print(f"{k}: {len(m[v])}, {len(m[v])/len(v)}")
g1w_l = (m.game_winner_g1 != m.winner).sum()
g1w_w = (m.game_winner_g1 == m.winner).sum()
g1w_w / (g1w_l + g1w_w)
g1w = m[m.game_winner_g1 == m.winner]
g1l = m[m.game_winner_g1 != m.winner]
g1w_w_noaway = len(g1w[g1w.win_cond != 'away'])
g1w_w_noaway / (g1w_l + g1w_w_noaway)
with_away = []
no_away = []
for i in range(1000):
    boot = m.sample(1000, replace=True)
    g1w_l = (boot.game_winner_g1 != boot.winner).sum()
    g1w_w = (boot.game_winner_g1 == boot.winner).sum()
    g1w = boot[boot.game_winner_g1 == boot.winner]
    g1w_w_noaway = len(g1w[g1w.win_cond != 'away'])
    with_away.append(g1w_w / (g1w_l + g1w_w))
    no_away.append(g1w_w_noaway / (g1w_l + g1w_w_noaway))
sns.histplot(x=with_away)
plt.xlabel('% Chance of winning if you win game 1')
plt.show()
sns.histplot(x=no_away)
plt.xlabel('% Chance of winning if you win game 1 - without away matches')
plt.show()<jupyter_output><empty_output><jupyter_text>High Scoring games - Home or Away  I don't know what a high scoring game would be exactly. I've watched a lot of soccer matches. I'd say over 3-4 is probably high scoring.
 To do it more precisely, let's find the median goals scored in a game for the champions league.<jupyter_code>games.goalstotal.describe()
sns.set_theme(style="whitegrid")
sns.boxplot(x=games.goalstotal, palette='Set3')
plt.show()
sns.boxplot(x=m.total_goals);
plt.show()
sns.histplot(x=m.total_goals);
plt.show()<jupyter_output><empty_output><jupyter_text>I want to find when home or away has a high score<jupyter_code># g1high = m[m.goalstotal_g1 > 3]
# g2high = m[m.goalstotal_g2 > 3]
g1high_or_low = pd.Series(
                    np.where(m.goalstotal_g1 > 3, 'g1high', 'no_g1high')
                    )
g2high_or_low = pd.Series(
                    np.where(m.goalstotal_g2 > 3, 'g2high', 'no_g2high')
                    )
# g1high = away[away.goalstotal_g1 > 3]
# g2high = away[away.goalstotal_g2 > 3]
away_g1high_or_low = pd.Series(
                    np.where(away.goalstotal_g1 > 3, 'g1high', 'no_g1high')
                    )
away_g2high_or_low = pd.Series(
                    np.where(away.goalstotal_g2 > 3, 'g2high', 'no_g2high')
                    )
away_g1high_or_low.value_counts(), away_g1high_or_low.value_counts(normalize=True)
away_g2high_or_low.value_counts(), away_g2high_or_low.value_counts(normalize=True)
percent = round(g1high_or_low.value_counts(normalize=True) * 100, 2)
ax = sns.countplot(x=g1high_or_low)
ax.set_ylabel('Number of Games')
ax.set_xticks(range(2))
ax.set_xticklabels(['Gm1 normal scoring', 'Gm1 high scoring'])
for i in range(len(ax.patches)):
    x = ax.patches[i].get_x() + ax.patches[i].get_width()/2
    y = ax.patches[i].get_height()/2
    ax.annotate(f"{percent[i]}%", (x, y), ha='center')
plt.show();
percent = round(g2high_or_low.value_counts(normalize=True) * 100, 2)
ax = sns.countplot(x=g2high_or_low)
ax.set_ylabel('Number of Games')
ax.set_xticks(range(2))
ax.set_xticklabels(['Gm2 normal scoring', 'Gm2 high scoring'])
for i in range(len(ax.patches)):
    x = ax.patches[i].get_x() + ax.patches[i].get_width()/2
    y = ax.patches[i].get_height()/2
    ax.annotate(f"{percent[i]}%", (x, y), ha='center')
plt.show();<jupyter_output><empty_output><jupyter_text>Total Goals<jupyter_code># looking at the distribution of total goals and if there is much of a difference per round.
# the semis are a little more likely to be low scoring
sns.histplot(x=m.total_goals);
plt.show()
sns.boxplot(x=m.total_goals);
plt.show()
sns.violinplot(x='rnd', y='total_goals', data=m);
plt.show()
# there is a clear difference in the coef difference between the first two knockout rounds and the semis. 
# It would make more sense that the violin plot above shows the semis have closer games.
sns.barplot(x='rnd', y=abs(m.coefdiff_g1), data=m, order=['r16', 'quarters', 'semis'])
plt.show()<jupyter_output><empty_output><jupyter_text>What defines a close game?<jupyter_code>sns.countplot(x=abs(m.goalstotal_g1 - m.goalstotal_g2));
plt.xlabel(' Absolute difference in goals between game 1 and 2')
plt.show()
# I would say that any game with a total goal difference over 3 is good given that it would be within the 4th quartile
sns.boxplot(x=abs(m.goalstotal_g1 - m.goalstotal_g2))
plt.show()
# total number of uneven matchups and percent of all matchups

(abs(m.goalstotal_g1 - m.goalstotal_g2) > 3).sum(), (abs(m.goalstotal_g1 - m.goalstotal_g2) > 3).sum() / len(m)
m[['win_cond']][abs(m.goalstotal_g1 - m.goalstotal_g2) > 3].value_counts()
# 17% of matchups that are uneven in total goals from g1 to g2 are won by away goal rule
# This is important because my idea was that g1 and g2 are more independent than generally believed
m[['win_cond']][abs(m.goalstotal_g1 - m.goalstotal_g2) > 3].value_counts(normalize=True)
# let's check 17% against away goals rules in all matchups
# it's slightly higher than the whole population 
m[['win_cond']].value_counts(normalize=True)
# How many does the home team of the high scoring game lose?
m['win_cond'][((m.goalstotal_g1 - m.goalstotal_g2) > 3 ) & 
    (m.h_team_g1 == m.loser)].value_counts()

m['win_cond'][((m.goalstotal_g1 - m.goalstotal_g2) < -3 ) & 
    (m.h_team_g2 == m.loser)].value_counts()
m['coefdiff_g1'][((m.goalstotal_g1 - m.goalstotal_g2) > 3 ) & 
    (m.h_team_g1 == m.loser)].abs().median()<jupyter_output><empty_output><jupyter_text>It appears there isn't much of a connection in away goal rules and uneven g1 score and g2 scores.<jupyter_code>m.columns

# print(m[(high_scoring_g1) & (m.h_team_g1 == m.game_winner_g1)]['win_cond'].value_counts())
# print(m[(high_scoring_g1) & (m.h_team_g1 == m.game_winner_g1)]['win_cond'].value_counts(normalize=True))
# print(m[(high_scoring_g1) & (m.h_team_g1 == m.game_winner_g1) & (m.h_team_g1 == m.loser)]['win_cond'].value_counts())
# print(m[(high_scoring_g1) & (m.h_team_g1 == m.game_winner_g1) & (m.h_team_g1 == m.loser)]['win_cond'].value_counts(normalize=True))
def custom_combos(df: pd.DataFrame):
    
    high_scoring_g1 = df.goalstotal_g1 > 3

    print('Gm1 Home team wins or loses matchup',
        df[df.h_team_g1 != df.loser]['win_cond'].count(),
        df[df.h_team_g1 == df.loser]['win_cond'].count()
    )

    print('Gm1 Home team Coef is greater or less than the away team',
        np.sum(df.h_coef_g1 > df.a_coef_g1), 
        np.sum(df.h_coef_g1 < df.a_coef_g1)
    )

    temp_df = pd.DataFrame()
    temp_df['Game 1 Home Winner'] = np.select([df.h_team_g1 != df.loser, df.h_team_g1 == df.loser], ['winner', 'loser'])
    temp_df['Game 1 Home Higher Coef'] = np.select([df.h_coef_g1 > df.a_coef_g1, df.h_coef_g1 < df.a_coef_g1], ['Higher', 'Lower'], 'equal')
    sns.set()
    temp_df[['Game 1 Home Winner']].value_counts().plot(kind='pie')
    plt.ylabel('')
    plt.title('Game 1 Home Team - Matchup Result')
    plt.show()
    temp_df[['Game 1 Home Higher Coef']].value_counts().plot(kind='pie')
    plt.title('Game 1 Home Team - Coef Compared to Opponent')
    plt.ylabel('')
    plt.show()

    print( 'High scoring Gm1, Gm1 Home team loses matchup',
        df[(high_scoring_g1) & (df.h_team_g1 != df.loser)]['win_cond'].count(),
        df[(high_scoring_g1) & (df.h_team_g1 == df.loser)]['win_cond'].count()
    )

    # High scoring Gm1, Gm1 Home team loses or wins matchup, only for closer matchups because many are just a big club thumping a little club
    close_matchup = df.coefdiff_g1.abs() < df.coefdiff_g1.abs().std()
    print( 'High scoring Gm1, Gm1 Home team loses or wins matchup, closer matchups',
        df[(high_scoring_g1) & (df.h_team_g1 != df.loser) & close_matchup]['win_cond'].count(),
        df[(high_scoring_g1) & (df.h_team_g1 == df.loser) & close_matchup]['win_cond'].count()
    )

    
    print('Teams are closely matched, winner or loser of matchup',
        df[(df.h_team_g1 != df.loser) & close_matchup]['win_cond'].count(),
        df[(df.h_team_g1 == df.loser) & close_matchup]['win_cond'].count()
    )


    print( 'Gm1 home team coef is greater, winner or loser of matchup',
        df[(df.h_team_g1 != df.loser) & (df.h_coef_g1 > df.a_coef_g1)]['win_cond'].count(),
        df[(df.h_team_g1 == df.loser) & (df.h_coef_g1 > df.a_coef_g1)]['win_cond'].count()
    )

    print( 'Gm1 home team coef is greater, close matchup, winner or loser of matchup',
        df[(df.h_team_g1 != df.loser) & (df.h_coef_g1 > df.a_coef_g1) & (close_matchup)]['win_cond'].count(),
        df[(df.h_team_g1 == df.loser) & (df.h_coef_g1 > df.a_coef_g1) & (close_matchup)]['win_cond'].count()
    )


    print('High scoring Gm1, Gm1 Home team wins Gm1, Gm1 Home team loses or wins matchup',
        df[(high_scoring_g1) & (df.h_team_g1 == df.game_winner_g1) & (df.h_team_g1 != df.loser) & close_matchup]['win_cond'].count(),
        df[(high_scoring_g1) & (df.h_team_g1 == df.game_winner_g1) & (df.h_team_g1 == df.loser) & close_matchup]['win_cond'].count()
    )



# Who plays at home first in the quarters and semis are completely random - r16 is less random, and typically the worse team plays at home first
quarters_semis = m[m.rnd.isin(['quarters', 'semis'])]
custom_combos(quarters_semis)

# Percent of the time that the home team for game 1 has a lower coef than the away team
gm1_hteam_loss = 44
np.random.seed(1234)
random_matchups = np.random.binomial(n=114, p=.5, size=1000)
np.sum(random_matchups < gm1_hteam_loss) / len(random_matchups)
sns.histplot(data=random_matchups)
plt.axvline(gm1_hteam_loss, color='r')
plt.xlabel('Number of Teams with a Higher Coef')
plt.title('If Randomly Choosing 114 Teams')
plt.show()
def more_combos(df: pd.DataFrame, game: int):

    
    close_gm1 = abs(df.h_score_g1 - df.a_score_g1) < 2
    close_gm2 = abs(df.h_score_g2 - df.a_score_g2) < 2
    high_scoring_gm1 = df.goalstotal_g1 > 3
    high_scoring_gm2 = df.goalstotal_g2 > 3

    # I decided to change unevan scoring, becuase the commented one is probably too strict
    # uneven_scoring = abs(df.goalstotal_g1 - df.goalstotal_g2) > 3
    uneven_scoring = high_scoring_gm1 ^ high_scoring_gm2

    if game == 1:
        print('Close Gm1')
        print(df[close_gm1]['win_cond'].value_counts())

        print('Close Gm1 + gm1 home team win/lose')
        print('wins')
        print(df[close_gm1 & (df.h_team_g1 != df.loser)]['win_cond'].value_counts())
        print('losses')
        print(df[close_gm1 & (df.h_team_g1 == df.loser)]['win_cond'].value_counts())

        print('Gm1 High Scoring + gm1 home team win/lose')
        print('wins')
        print(df[high_scoring_gm1 & (df.h_team_g1 == df.winner)]['win_cond'].value_counts())
        print('losses')
        print(df[high_scoring_gm1 & (df.h_team_g1 == df.loser)]['win_cond'].value_counts())

        print('Close Gm1 + Gm1 High Scoring + gm1 home team win/lose')
        print('wins')
        print(df[close_gm1 & high_scoring_gm1 & (df.h_team_g1 == df.winner)]['win_cond'].value_counts())
        print('losses')
        print(df[close_gm1 & high_scoring_gm1 & (df.h_team_g1 == df.loser)]['win_cond'].value_counts())

        print('Close Gm1 + Gm1 High Scoring + Uneven scoring')
        print(df[close_gm1 & high_scoring_gm1 & uneven_scoring]['win_cond'].value_counts())

        print('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team win/lose')
        print('wins')
        print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_team_g1 == df.winner)]['win_cond'].value_counts())
        print('losses')
        print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_team_g1 == df.loser)]['win_cond'].value_counts())

        print('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team coef higher/lower')
        print('higher')
        print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_coef_g1 > df.a_coef_g1)]['win_cond'].value_counts())
        print('equal')
        print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_coef_g1 == df.a_coef_g1)]['win_cond'].value_counts())
        print('lower')
        print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_coef_g1 < df.a_coef_g1)]['win_cond'].value_counts())

        print('gm1 home team win/lose')
        print('wins')
        print(df[(df.h_team_g1 == df.winner)]['win_cond'].value_counts())
        print('losses')
        print(df[(df.h_team_g1 == df.loser)]['win_cond'].value_counts())

        print('gm1 home team coef higher/lower')
        print('higher')
        print(df[(df.h_coef_g1 > df.a_coef_g1)]['win_cond'].value_counts())
        print('equal')
        print(df[(df.h_coef_g1 == df.a_coef_g1)]['win_cond'].value_counts())
        print('lower')
        print(df[(df.h_coef_g1 < df.a_coef_g1)]['win_cond'].value_counts())

        print('gm1 home team win/lose')
        print('wins')
        print(df[(df.h_team_g1 == df.winner)]['win_cond'].value_counts())
        print('losses')
        print(df[(df.h_team_g1 == df.loser)]['win_cond'].value_counts())

        print('gm1 home team coef win+higher/lose+lower')
        print('higher')
        print(df[(df.h_team_g1 == df.winner) & (df.h_coef_g1 > df.a_coef_g1)]['win_cond'].value_counts())

        print('lower')
        print(df[(df.h_team_g1 == df.loser) & (df.h_coef_g1 < df.a_coef_g1)]['win_cond'].value_counts())






    if game == 2:

        print('Gm2 High Scoring')
        print(df[high_scoring_gm2 & (df.h_team_g2 == df.loser)]['win_cond'].value_counts())

        print('Close Gm2 + Gm2 High Scoring')
        print(df[close_gm2 & high_scoring_gm2 & (df.h_team_g2 == df.loser)]['win_cond'].value_counts())
        # print(df[close_gm2 & high_scoring_gm2 & (df.h_team_g2 == df.loser)]['win_cond'].value_counts(normalize=True))

        print('Close Gm2 + Gm2 High Scoring + Uneven scoring')
        print(df[close_gm2 & high_scoring_gm2 & uneven_scoring]['win_cond'].value_counts())
        # print(df[close_gm2 & high_scoring_gm2 & uneven_scoring]['win_cond'].value_counts(normalize=True))

        print('Close Gm2 + Uneven scoring + Gm2 High scoring + Gm2 Home Team loser')
        print('wins')
        print(df[close_gm2 & uneven_scoring & high_scoring_gm2 & (df.h_team_g2 == df.winner)]['win_cond'].value_counts())
        print('losses')
        print(df[close_gm2 & uneven_scoring & high_scoring_gm2 & (df.h_team_g2 == df.loser)]['win_cond'].value_counts())
        # print(df[close_gm2 & uneven_scoring & high_scoring_gm2 & (df.h_team_g2 == df.loser)]['win_cond'].value_counts(normalize=True))

        print('Close Gm2 + Uneven scoring + Gm2 High scoring + gm2 home team coef higher/lower')
        print('higher')
        print(df[close_gm2 & uneven_scoring & high_scoring_gm2 & (df.h_coef_g1 < df.a_coef_g1)]['win_cond'].value_counts())
        print('lower')
        print(df[close_gm2 & uneven_scoring & high_scoring_gm2 & (df.h_coef_g1 > df.a_coef_g1)]['win_cond'].value_counts())

def gm1close_uneven_gm1high(df):    
    close_gm1 = abs(df.h_score_g1 - df.a_score_g1) < 2
    close_gm2 = abs(df.h_score_g2 - df.a_score_g2) < 2
    high_scoring_gm1 = df.goalstotal_g1 > 3
    high_scoring_gm2 = df.goalstotal_g2 > 3
    uneven_scoring = high_scoring_gm1 ^ high_scoring_gm2

    
    df['g1_home_winner'] = np.where((df.h_team_g1 == df.winner), 'winner', 'loser')

    _ = df[close_gm1 & uneven_scoring & high_scoring_gm1]
    sns.countplot(x='g1_home_winner', order=['winner', 'loser'], data=_)
    plt.ylim([0,18])
    plt.title('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team win/lose')
    plt.show()

    sns.countplot(x='g1_home_winner', hue='win_cond', order=['winner', 'loser'], data=_)
    plt.ylim([0,18])
    plt.title('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team win/lose')
    plt.show()

    df['g1_home_higher'] = np.where((df.h_coef_g1 > df.a_coef_g1), 'higher', 'lower')
    _ = df[close_gm1 & uneven_scoring & high_scoring_gm1]
    sns.countplot(x='g1_home_higher', order=['higher', 'lower'], data=_)
    plt.ylim([0,18])
    plt.title('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team coef higher/lower')
    plt.show()

    _ = df[close_gm1 & uneven_scoring & high_scoring_gm1]
    sns.countplot(x='g1_home_higher', hue='win_cond', order=['higher', 'lower'], data=_)
    plt.ylim([0,18])
    plt.title('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team coef higher/lower')
    plt.show()

    # print('Close Gm1 + Uneven scoring + Gm1 High scoring + gm1 home team coef higher/lower')
    # print('higher')
    # print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_coef_g1 > df.a_coef_g1)]['win_cond'].value_counts())
    # print('equal')
    # print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_coef_g1 == df.a_coef_g1)]['win_cond'].value_counts())
    # print('lower')
    # print(df[close_gm1 & uneven_scoring & high_scoring_gm1 & (df.h_coef_g1 < df.a_coef_g1)]['win_cond'].value_counts())
gm1close_uneven_gm1high(m)
m['g1_home_winner'] = np.where((m.h_team_g1 == m.winner), 'winner', 'loser')
more_combos(m, 1)
more_combos(m, 2)
m['g1_home_winner'] = np.where((m.h_team_g1 == m.winner), 'winner', 'loser')
m['g2_home_winner'] = np.where((m.h_team_g2 == m.winner), 'winner', 'loser')
m[(m.h_coef_g1 > m.a_coef_g1)][['g1_home_winner', 'win_cond']].value_counts()

m[(m.h_coef_g1 < m.a_coef_g1)][['g2_home_winner', 'win_cond']].value_counts()
_ = m[(m.h_coef_g1 > m.a_coef_g1)]
sns.countplot(x='g1_home_winner', order=['winner', 'loser'], data=_)
plt.ylim([0,120])
plt.title('When Gm1 Home Team is Ranked Higher')
plt.show()
_ = m[(m.h_coef_g1 > m.a_coef_g1)]
sns.countplot(x='g1_home_winner', order=['winner', 'loser'], hue='win_cond', data=_)
plt.ylim([0,120])
plt.title('When Gm1 Home Team is Ranked Higher')
plt.show()
_ = m[(m.h_coef_g1 < m.a_coef_g1)]
sns.countplot(x='g2_home_winner', data=_)
plt.ylim([0,120])
plt.title('When Gm2 Home Team is Ranked Higher')
plt.show()
_ = m[(m.h_coef_g1 < m.a_coef_g1)]
sns.countplot(x='g2_home_winner', hue='win_cond', data=_)
plt.ylim([0,120])
plt.title('When Gm2 Home Team is Ranked Higher')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15757373612236147, 'fraction_numerical': 0.02801734407013866, 'mean_word_length': 3.9371912491178547, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 68, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '102741', 'license': 'MIT', 'n_tokens_mistral': 9049, 'n_tokens_neox': 8559, 'n_words': 1538, 'path': 'notebooks/8_away_goals.ipynb', 'repo_name': 'calvinscottforbes/champions_league_luck', 'size': '20987'}