튜토리얼

필수 데이터사이언스 방법론 가이드
카테고리는 수준별, 언어별, 분야별, 주제별 순으로 정렬되어 있습니다.

프리미어리그 경기 결과 예측

작성자
DaeSeo
작성일
2017-01-11 16:42
조회
118
카테고리 : [ 고급   |   Python   |   기타   |   예측 ]

1) 제목


프리미어리그 경기 결과 예측

2) 작성자


컴퓨터정보통신공학과 박대서

3) 링크 및 출처


  • Kaggle

4) 문제 및 개요


  • 프리미어리그(영국-EPL)의 전시즌 경기정보(매칭)를 토대로 2016/2017(13주차)의 경기결과를 예측

5) 데이터


Kaggle에서 제공하는 European Soccer Database 데이터 활용

6) 해결방법 및 결과


  • 유럽 축구 데이터 중 프리미어리그에 해당하는 경기만 추출

  • import numpy as np # linear algebra
    import pandas as pd # data processing,

    import sqlalchemy
    from sqlalchemy import create_engine # database connection
    import sqlite3

    import matplotlib.pyplot as plt
    import seaborn as sns
    from IPython.display import display, clear_output
    from sklearn.naive_bayes import MultinomialNB
    from sklearn.naive_bayes import GaussianNB
    from sklearn.ensemble import RandomForestClassifier
    from sklearn.metrics import classification_report, accuracy_score
    from sklearn import linear_model

    from subprocess import check_output

    # 예측 시즌 및 스테이지
    this_season = '2016/2017'
    this_week = 13

    with sqlite3.connect('database.sqlite') as engine:
    matches = pd.read_sql_query('SELECT * FROM Match where league_id = 1729 ;', engine)
    matches = matches[matches.columns[:11]]
    teams = pd.read_sql_query('SELECT * FROM Team;', engine)

    # Add team names & tidy up
    matches = pd.merge(left=matches, right=teams, how='left', left_on='home_team_api_id', right_on='team_api_id')
    matches = matches.drop(['country_id','league_id', 'home_team_api_id', 'id_y', 'team_api_id', 'team_short_name'], axis=1)
    matches.rename(columns={'id_x':'match_id', 'team_long_name':'home_team'}, inplace=True)
    matches = pd.merge(left=matches, right=teams, how='left', left_on='away_team_api_id', right_on='team_api_id')
    matches = matches.drop(['id', 'match_api_id', 'away_team_api_id','team_api_id', 'team_short_name'], axis=1)
    matches.rename(columns={'id_x':'match_id', 'team_long_name':'away_team'}, inplace=True)

    matches.tail()


  • match_id season stage date home_team_goal away_team_goal home_team away_team
    3001 4730 2015/2016 9 2015-10-17 00:00:00 2 2 Southampton Leicester
    3002 4731 2015/2016 9 2015-10-19 00:00:00 0 1 Swansea Stoke
    3003 4732 2015/2016 9 2015-10-17 00:00:00 0 0 Tottenham Liverpool
    3004 4733 2015/2016 9 2015-10-17 00:00:00 0 3 Watford Arsenal
    3005 4734 2015/2016 9 2015-10-17 00:00:00 1 0 West Bromwich Albion Sunderland

 
latest_match_data = [
{'match_id':6000, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Burnley', 'away_team':'Swansea City'},
{'match_id':6001, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Crystal Palace', 'away_team':'West Bromwich Albion'},
{'match_id':6002, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Everton', 'away_team':'Tottenham Hotspur'},
{'match_id':6003, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Hull City', 'away_team':'Leicester City'},
{'match_id':6004, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Manchester City', 'away_team':'Sunderland'},
{'match_id':6005, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Middlesbrough', 'away_team':'Stoke City'},
{'match_id':6006, 'season':'2016/2017', 'stage':1, 'date':'42595', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Southampton', 'away_team':'Watford'},
{'match_id':6007, 'season':'2016/2017', 'stage':1, 'date':'42596', 'home_team_goal':3, 'away_team_goal':4, 'home_team':'Arsenal', 'away_team':'Liverpool'},
{'match_id':6008, 'season':'2016/2017', 'stage':1, 'date':'42596', 'home_team_goal':1, 'away_team_goal':3, 'home_team':'Bournemouth', 'away_team':'Manchester United'},
{'match_id':6009, 'season':'2016/2017', 'stage':1, 'date':'42597', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Chelsea', 'away_team':'West Ham United'},
{'match_id':6010, 'season':'2016/2017', 'stage':2, 'date':'42601', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Manchester United', 'away_team':'Southampton'},
{'match_id':6011, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Burnley', 'away_team':'Liverpool'},
{'match_id':6012, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Leicester City', 'away_team':'Arsenal'},
{'match_id':6013, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':1, 'away_team_goal':4, 'home_team':'Stoke City', 'away_team':'Manchester City'},
{'match_id':6014, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':0, 'away_team_goal':2, 'home_team':'Swansea City', 'away_team':'Hull City'},
{'match_id':6015, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Tottenham Hotspur', 'away_team':'Crystal Palace'},
{'match_id':6016, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Watford', 'away_team':'Chelsea'},
{'match_id':6017, 'season':'2016/2017', 'stage':2, 'date':'42602', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'West Bromwich Albion', 'away_team':'Everton'},
{'match_id':6018, 'season':'2016/2017', 'stage':2, 'date':'42603', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Sunderland', 'away_team':'Middlesbrough'},
{'match_id':6019, 'season':'2016/2017', 'stage':2, 'date':'42603', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'West Ham United', 'away_team':'Bournemouth'},
{'match_id':6020, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':3, 'away_team_goal':0, 'home_team':'Chelsea', 'away_team':'Burnley'},
{'match_id':6021, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Crystal Palace', 'away_team':'Bournemouth'},
{'match_id':6022, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Everton', 'away_team':'Stoke City'},
{'match_id':6023, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Hull City', 'away_team':'Manchester United'},
{'match_id':6024, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Leicester City', 'away_team':'Swansea City'},
{'match_id':6025, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Southampton', 'away_team':'Sunderland'},
{'match_id':6026, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Tottenham Hotspur', 'away_team':'Liverpool'},
{'match_id':6027, 'season':'2016/2017', 'stage':3, 'date':'42609', 'home_team_goal':1, 'away_team_goal':3, 'home_team':'Watford', 'away_team':'Arsenal'},
{'match_id':6028, 'season':'2016/2017', 'stage':3, 'date':'42610', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Manchester City', 'away_team':'West Ham United'},
{'match_id':6029, 'season':'2016/2017', 'stage':3, 'date':'42610', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'West Bromwich Albion', 'away_team':'Middlesbrough'},
{'match_id':6030, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Arsenal', 'away_team':'Southampton'},
{'match_id':6031, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Bournemouth', 'away_team':'West Bromwich Albion'},
{'match_id':6032, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Burnley', 'away_team':'Hull City'},
{'match_id':6033, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':4, 'away_team_goal':1, 'home_team':'Liverpool', 'away_team':'Leicester City'},
{'match_id':6034, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Manchester United', 'away_team':'Manchester City'},
{'match_id':6035, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Middlesbrough', 'away_team':'Crystal Palace'},
{'match_id':6036, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':0, 'away_team_goal':4, 'home_team':'Stoke City', 'away_team':'Tottenham Hotspur'},
{'match_id':6037, 'season':'2016/2017', 'stage':4, 'date':'42623', 'home_team_goal':2, 'away_team_goal':4, 'home_team':'West Ham United', 'away_team':'Watford'},
{'match_id':6038, 'season':'2016/2017', 'stage':4, 'date':'42624', 'home_team_goal':2, 'away_team_goal':2, 'home_team':'Swansea City', 'away_team':'Chelsea'},
{'match_id':6039, 'season':'2016/2017', 'stage':4, 'date':'42625', 'home_team_goal':0, 'away_team_goal':3, 'home_team':'Sunderland', 'away_team':'Everton'},
{'match_id':6040, 'season':'2016/2017', 'stage':5, 'date':'42629', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Chelsea', 'away_team':'Liverpool'},
{'match_id':6041, 'season':'2016/2017', 'stage':5, 'date':'42630', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Everton', 'away_team':'Middlesbrough'},
{'match_id':6042, 'season':'2016/2017', 'stage':5, 'date':'42630', 'home_team_goal':1, 'away_team_goal':4, 'home_team':'Hull City', 'away_team':'Arsenal'},
{'match_id':6043, 'season':'2016/2017', 'stage':5, 'date':'42630', 'home_team_goal':3, 'away_team_goal':0, 'home_team':'Leicester City', 'away_team':'Burnley'},
{'match_id':6044, 'season':'2016/2017', 'stage':5, 'date':'42630', 'home_team_goal':4, 'away_team_goal':0, 'home_team':'Manchester City', 'away_team':'Bournemouth'},
{'match_id':6045, 'season':'2016/2017', 'stage':5, 'date':'42630', 'home_team_goal':4, 'away_team_goal':2, 'home_team':'West Bromwich Albion', 'away_team':'West Ham United'},
{'match_id':6046, 'season':'2016/2017', 'stage':5, 'date':'42631', 'home_team_goal':4, 'away_team_goal':1, 'home_team':'Crystal Palace', 'away_team':'Stoke City'},
{'match_id':6047, 'season':'2016/2017', 'stage':5, 'date':'42631', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Southampton', 'away_team':'Swansea City'},
{'match_id':6048, 'season':'2016/2017', 'stage':5, 'date':'42631', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Tottenham Hotspur', 'away_team':'Sunderland'},
{'match_id':6049, 'season':'2016/2017', 'stage':5, 'date':'42631', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Watford', 'away_team':'Manchester United'},
{'match_id':6050, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':3, 'away_team_goal':0, 'home_team':'Arsenal', 'away_team':'Chelsea'},
{'match_id':6051, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Bournemouth', 'away_team':'Everton'},
{'match_id':6052, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':5, 'away_team_goal':1, 'home_team':'Liverpool', 'away_team':'Hull City'},
{'match_id':6053, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':4, 'away_team_goal':1, 'home_team':'Manchester United', 'away_team':'Leicester City'},
{'match_id':6054, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Middlesbrough', 'away_team':'Tottenham Hotspur'},
{'match_id':6055, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Stoke City', 'away_team':'West Bromwich Albion'},
{'match_id':6056, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':2, 'away_team_goal':3, 'home_team':'Sunderland', 'away_team':'Crystal Palace'},
{'match_id':6057, 'season':'2016/2017', 'stage':6, 'date':'42637', 'home_team_goal':1, 'away_team_goal':3, 'home_team':'Swansea City', 'away_team':'Manchester City'},
{'match_id':6058, 'season':'2016/2017', 'stage':6, 'date':'42638', 'home_team_goal':0, 'away_team_goal':3, 'home_team':'West Ham United', 'away_team':'Southampton'},
{'match_id':6059, 'season':'2016/2017', 'stage':6, 'date':'42639', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Burnley', 'away_team':'Watford'},
{'match_id':6060, 'season':'2016/2017', 'stage':7, 'date':'42643', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Everton', 'away_team':'Crystal Palace'},
{'match_id':6061, 'season':'2016/2017', 'stage':7, 'date':'42644', 'home_team_goal':0, 'away_team_goal':2, 'home_team':'Hull City', 'away_team':'Chelsea'},
{'match_id':6062, 'season':'2016/2017', 'stage':7, 'date':'42644', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Sunderland', 'away_team':'West Bromwich Albion'},
{'match_id':6063, 'season':'2016/2017', 'stage':7, 'date':'42644', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Swansea City', 'away_team':'Liverpool'},
{'match_id':6064, 'season':'2016/2017', 'stage':7, 'date':'42644', 'home_team_goal':2, 'away_team_goal':2, 'home_team':'Watford', 'away_team':'Bournemouth'},
{'match_id':6065, 'season':'2016/2017', 'stage':7, 'date':'42644', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'West Ham United', 'away_team':'Middlesbrough'},
{'match_id':6066, 'season':'2016/2017', 'stage':7, 'date':'42645', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Burnley', 'away_team':'Arsenal'},
{'match_id':6067, 'season':'2016/2017', 'stage':7, 'date':'42645', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Leicester City', 'away_team':'Southampton'},
{'match_id':6068, 'season':'2016/2017', 'stage':7, 'date':'42645', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Manchester United', 'away_team':'Stoke City'},
{'match_id':6069, 'season':'2016/2017', 'stage':7, 'date':'42645', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Tottenham Hotspur', 'away_team':'Manchester City'},
{'match_id':6070, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':3, 'away_team_goal':0, 'home_team':'Chelsea', 'away_team':'Leicester City'},
{'match_id':6071, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':3, 'away_team_goal':2, 'home_team':'Arsenal', 'away_team':'Swansea City'},
{'match_id':6072, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':6, 'away_team_goal':1, 'home_team':'Bournemouth', 'away_team':'Hull City'},
{'match_id':6073, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Manchester City', 'away_team':'Everton'},
{'match_id':6074, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Stoke City', 'away_team':'Sunderland'},
{'match_id':6075, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'West Bromwich Albion', 'away_team':'Tottenham Hotspur'},
{'match_id':6076, 'season':'2016/2017', 'stage':8, 'date':'42658', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Crystal Palace', 'away_team':'West Ham United'},
{'match_id':6077, 'season':'2016/2017', 'stage':8, 'date':'42659', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Middlesbrough', 'away_team':'Watford'},
{'match_id':6078, 'season':'2016/2017', 'stage':8, 'date':'42659', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Southampton', 'away_team':'Burnley'},
{'match_id':6079, 'season':'2016/2017', 'stage':8, 'date':'42660', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Liverpool', 'away_team':'Manchester United'},
{'match_id':6080, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Bournemouth', 'away_team':'Tottenham Hotspur'},
{'match_id':6081, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Arsenal', 'away_team':'Middlesbrough'},
{'match_id':6082, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Burnley', 'away_team':'Everton'},
{'match_id':6083, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':4, 'away_team_goal':0, 'home_team':'Chelsea', 'away_team':'Manchester United'},
{'match_id':6084, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':0, 'away_team_goal':2, 'home_team':'Hull City', 'away_team':'Stoke City'},
{'match_id':6085, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Leicester City', 'away_team':'Crystal Palace'},
{'match_id':6086, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Liverpool', 'away_team':'West Bromwich Albion'},
{'match_id':6087, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Manchester City', 'away_team':'Southampton'},
{'match_id':6088, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Swansea City', 'away_team':'Watford'},
{'match_id':6089, 'season':'2016/2017', 'stage':9, 'date':'42665', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'West Ham United', 'away_team':'Sunderland'},
{'match_id':6090, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':2, 'away_team_goal':4, 'home_team':'Crystal Palace', 'away_team':'Liverpool'},
{'match_id':6091, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Manchester United', 'away_team':'Burnley'},
{'match_id':6092, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':1, 'away_team_goal':4, 'home_team':'Sunderland', 'away_team':'Arsenal'},
{'match_id':6093, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Tottenham Hotspur', 'away_team':'Leicester City'},
{'match_id':6094, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Watford', 'away_team':'Hull City'},
{'match_id':6095, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':0, 'away_team_goal':4, 'home_team':'West Bromwich Albion', 'away_team':'Manchester City'},
{'match_id':6096, 'season':'2016/2017', 'stage':10, 'date':'42672', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Middlesbrough', 'away_team':'Bournemouth'},
{'match_id':6097, 'season':'2016/2017', 'stage':10, 'date':'42673', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Everton', 'away_team':'West Ham United'},
{'match_id':6098, 'season':'2016/2017', 'stage':10, 'date':'42673', 'home_team_goal':0, 'away_team_goal':2, 'home_team':'Southampton', 'away_team':'Chelsea'},
{'match_id':6099, 'season':'2016/2017', 'stage':10, 'date':'42674', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Stoke City', 'away_team':'Swansea City'},
{'match_id':6100, 'season':'2016/2017', 'stage':11, 'date':'42679', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Bournemouth', 'away_team':'Sunderland'},
{'match_id':6101, 'season':'2016/2017', 'stage':11, 'date':'42679', 'home_team_goal':3, 'away_team_goal':2, 'home_team':'Burnley', 'away_team':'Crystal Palace'},
{'match_id':6102, 'season':'2016/2017', 'stage':11, 'date':'42679', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Manchester City', 'away_team':'Middlesbrough'},
{'match_id':6103, 'season':'2016/2017', 'stage':11, 'date':'42679', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'West Ham United', 'away_team':'Stoke City'},
{'match_id':6104, 'season':'2016/2017', 'stage':11, 'date':'42679', 'home_team_goal':5, 'away_team_goal':0, 'home_team':'Chelsea', 'away_team':'Everton'},
{'match_id':6105, 'season':'2016/2017', 'stage':11, 'date':'42680', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Arsenal', 'away_team':'Tottenham Hotspur'},
{'match_id':6106, 'season':'2016/2017', 'stage':11, 'date':'42680', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Hull City', 'away_team':'Southampton'},
{'match_id':6107, 'season':'2016/2017', 'stage':11, 'date':'42680', 'home_team_goal':6, 'away_team_goal':1, 'home_team':'Liverpool', 'away_team':'Watford'},
{'match_id':6108, 'season':'2016/2017', 'stage':11, 'date':'42680', 'home_team_goal':1, 'away_team_goal':3, 'home_team':'Swansea City', 'away_team':'Manchester United'},
{'match_id':6109, 'season':'2016/2017', 'stage':11, 'date':'42680', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Leicester City', 'away_team':'West Bromwich Albion'},
{'match_id':6110, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Manchester United', 'away_team':'Arsenal'},
{'match_id':6111, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Crystal Palace', 'away_team':'Manchester City'},
{'match_id':6112, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Everton', 'away_team':'Swansea City'},
{'match_id':6113, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':0, 'away_team_goal':0, 'home_team':'Southampton', 'away_team':'Liverpool'},
{'match_id':6114, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Stoke City', 'away_team':'Bournemouth'},
{'match_id':6115, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':3, 'away_team_goal':0, 'home_team':'Sunderland', 'away_team':'Hull City'},
{'match_id':6116, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Watford', 'away_team':'Leicester City'},
{'match_id':6117, 'season':'2016/2017', 'stage':12, 'date':'42693', 'home_team_goal':3, 'away_team_goal':2, 'home_team':'Tottenham Hotspur', 'away_team':'West Ham United'},
{'match_id':6118, 'season':'2016/2017', 'stage':12, 'date':'42694', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Middlesbrough', 'away_team':'Chelsea'},
{'match_id':6119, 'season':'2016/2017', 'stage':12, 'date':'42695', 'home_team_goal':4, 'away_team_goal':0, 'home_team':'West Bromwich Albion', 'away_team':'Burnley'},
{'match_id':6120, 'season':'2016/2017', 'stage':13, 'date':'42700', 'home_team_goal':1, 'away_team_goal':2, 'home_team':'Burnley', 'away_team':'Manchester City'},
{'match_id':6121, 'season':'2016/2017', 'stage':13, 'date':'42700', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Hull City', 'away_team':'West Bromwich Albion'},
{'match_id':6122, 'season':'2016/2017', 'stage':13, 'date':'42700', 'home_team_goal':2, 'away_team_goal':2, 'home_team':'Leicester City', 'away_team':'Middlesbrough'},
{'match_id':6123, 'season':'2016/2017', 'stage':13, 'date':'42700', 'home_team_goal':2, 'away_team_goal':0, 'home_team':'Liverpool', 'away_team':'Sunderland'},
{'match_id':6124, 'season':'2016/2017', 'stage':13, 'date':'42700', 'home_team_goal':5, 'away_team_goal':4, 'home_team':'Swansea City', 'away_team':'Crystal Palace'},
{'match_id':6125, 'season':'2016/2017', 'stage':13, 'date':'42700', 'home_team_goal':2, 'away_team_goal':1, 'home_team':'Chelsea', 'away_team':'Tottenham Hotspur'},
{'match_id':6126, 'season':'2016/2017', 'stage':13, 'date':'42701', 'home_team_goal':0, 'away_team_goal':1, 'home_team':'Watford', 'away_team':'Stoke City'},
{'match_id':6127, 'season':'2016/2017', 'stage':13, 'date':'42701', 'home_team_goal':3, 'away_team_goal':1, 'home_team':'Arsenal', 'away_team':'Bournemouth'},
{'match_id':6128, 'season':'2016/2017', 'stage':13, 'date':'42701', 'home_team_goal':1, 'away_team_goal':1, 'home_team':'Manchester United', 'away_team':'West Ham United'},
{'match_id':6129, 'season':'2016/2017', 'stage':13, 'date':'42701', 'home_team_goal':1, 'away_team_goal':0, 'home_team':'Southampton', 'away_team':'Everton'}
]
latest_matches = pd.DataFrame(latest_match_data, columns=['match_id', 'season', 'stage', 'date',
'home_team_goal', 'away_team_goal',
'home_team','away_team'])
latest_matches.head(20)

# Add to full training data to predict current season
matches = pd.concat([matches, latest_matches])
matches = matches.reset_index(drop=True)

# Create a full set of match data that can be used with feature engineering later
full_matches = matches.copy()
full_matches.head(10)







match_id season stage date home_team_goal away_team_goal home_team away_team
0 1729 2008/2009 1 2008-08-17 00:00:00 1 1 Manchester United Newcastle United
1 1730 2008/2009 1 2008-08-16 00:00:00 1 0 Arsenal West Bromwich Albion
2 1731 2008/2009 1 2008-08-16 00:00:00 0 1 Sunderland Liverpool
3 1732 2008/2009 1 2008-08-16 00:00:00 2 1 West Ham Wigan
4 1733 2008/2009 1 2008-08-17 00:00:00 4 2 Aston Villa Manchester City
5 1734 2008/2009 1 2008-08-16 00:00:00 2 3 Everton Blackburn
6 1735 2008/2009 1 2008-08-16 00:00:00 2 1 Middlesbrough Tottenham
7 1736 2008/2009 1 2008-08-16 00:00:00 3 1 Bolton Stoke
8 1737 2008/2009 1 2008-08-16 00:00:00 2 1 Hull Fulham
9 1738 2008/2009 1 2008-08-17 00:00:00 4 0 Chelsea Portsmouth









  • 08/09 시즌 부터 16/17 시즌 최근까지의 경기 데이터를 필요한 컬럼만 추출
    • 시즌_날짜_홈팀골_어웨이팀골_홈팀_어웨이팀


  • 홈팀/어웨이팀에 대해서 승무패를 각각 기록

  • 한 행에 홈팀에 대한 승무패와 어웨이팀의 승무패를 홈팀골, 어웨이팀 골 수를 비교하여서 필드 추가

  • 승무패에 해당하는 컬럼에 1값, 비해당 시 0값 저장

# 매치별 경기결과 기록
def determine_result(match_list):
match_list['home_win'] = np.where(match_list['home_team_goal'] > match_list['away_team_goal'], 1, 0)
match_list['home_draw'] = np.where(match_list['home_team_goal'] == match_list['away_team_goal'], 1, 0)
match_list['home_lose'] = np.where(match_list['home_team_goal'] < match_list['away_team_goal'], 1, 0)
match_list['away_win'] = np.where(match_list['home_team_goal'] < match_list['away_team_goal'], 1, 0)
match_list['away_draw'] = np.where(match_list['home_team_goal'] == match_list['away_team_goal'], 1, 0)
match_list['away_lose'] = np.where(match_list['home_team_goal'] > match_list['away_team_goal'], 1, 0)

determine_result(full_matches)

# Sort in date order
full_matches.sort_values(by='date', inplace=True)

full_matches.head()

match_id season stage date home_team_goal away_team_goal home_team away_team home_win home_draw home_lose away_win away_draw away_lose
1 1730 2008/2009 1 2008-08-16 00:00:00 1 0 Arsenal West Bromwich Albion 1 0 0 0 0 1
2 1731 2008/2009 1 2008-08-16 00:00:00 0 1 Sunderland Liverpool 0 0 1 1 0 0
3 1732 2008/2009 1 2008-08-16 00:00:00 2 1 West Ham Wigan 1 0 0 0 0 1
5 1734 2008/2009 1 2008-08-16 00:00:00 2 3 Everton Blackburn 0 0 1 1 0 0
6 1735 2008/2009 1 2008-08-16 00:00:00 2 1 Middlesbrough Tottenham 1 0 0 0 0 1
 
# 각 시즌별 새로 승격한 팀 별도 표기 ( 정보가 없거나 부족 )
team_data = {'team':['West Bromwich Albion', 'Stoke City', 'Hull City',
'Wolverhampton Wanderers', 'Birmingham City', 'Burnley',
'Newcastle United', 'West Bromwich Albion', 'Blackpool',
'Queens Park Rangers', 'Norwich City', 'Swansea City',
'Reading', 'Southampton', 'West Ham United',
'Cardiff City', 'Crystal Palace', 'Hull City',
'Leicester City', 'Burnley', 'Queens Park Rangers',
'Bournemouth', 'Watford', 'Norwich City',
'Burnley', 'Middlesbrough', 'Hull City'
],
'season':["2008/2009", "2008/2009", "2008/2009",
"2009/2010", "2009/2010", "2009/2010",
"2010/2011", "2010/2011", "2010/2011",
"2011/2012", "2011/2012", "2011/2012",
"2012/2013", "2012/2013", "2012/2013",
"2013/2014", "2013/2014", "2013/2014",
"2014/2015", "2014/2015", "2014/2015",
"2015/2016", "2015/2016", "2015/2016",
"2016/2017", "2016/2017", "2016/2017"
]
}

new_teams = pd.DataFrame(team_data, columns=['team', 'season'])
new_teams.head()


team season
0 West Bromwich Albion 2008/2009
1 Stoke City 2008/2009
2 Hull City 2008/2009
3 Wolverhampton Wanderers 2009/2010
4 Birmingham City 2009/2010
  • 각 시즌별로 새로 승격한 팀은 정보가 부족하기 때문에 Promoted 라는 명칭으로 통일하여 관리





# 시즌별 매치에 승격팀은 promoted 표기

for index, row in new_teams.iterrows():
for index1, row1 in full_matches.iterrows():
if (row1['home_team'] == row['team']) & (row1['season'] == row['season']):
full_matches.loc[index1, 'home_team'] = 'Promoted'
if (row1['away_team'] == row['team']) & (row1['season'] == row['season']):
full_matches.loc[index1, 'away_team'] = 'Promoted'

#full_matches.head(20)










# 매치별로 홈팀 원정팀 설정
full_match_features = pd.DataFrame(full_matches[['season', 'stage']],
columns=[['season', 'stage']])

full_match_features = pd.concat([full_match_features, pd.get_dummies(full_matches['home_team']).rename(columns=lambda x: str(x) + '_h')],
axis=1)
full_match_features = pd.concat([full_match_features, pd.get_dummies(full_matches['away_team']).rename(columns=lambda x: str(x) + '_a')],
axis=1)

full_match_features.head()





season stage Arsenal_h Aston Villa_h Birmingham_h Blackburn_h Bolton_h Bournemouth_h Cardiff_h Chelsea_h ... Swansea_a Swansea City_a Tottenham_a Tottenham Hotspur_a Watford_a West Bromwich Albion_a West Ham_a West Ham United_a Wigan_a Wolverhampton Wanderers_a
1 2008/2009 1 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
2 2008/2009 1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 2008/2009 1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0
5 2008/2009 1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 2008/2009 1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
 
  • 각 시즌의 경기마다 어웨이 팀과 홈팀을 기록하여 분석에 적용

  • 13주차 경기는 예측하기 위한 트레이닝 데이터로 훈련데이터에서 제거

  • 최종적으로 16/17 시즌의 12스테이지까지 훈련데이터가 됨


 
# 2016/2017의 13주차 경기 예측 이므로 트레이닝 데이터에서 제외
train_match_features = full_match_features.loc[(full_match_features['season'] != this_season) |
(full_match_features['season'] == this_season) &
(full_match_features['stage'] < this_week)].copy()

train_match_features.drop(['season'], axis=1, inplace=True)
train_match_features.tail()

stage Arsenal_h Aston Villa_h Birmingham_h Blackburn_h Bolton_h Bournemouth_h Cardiff_h Chelsea_h Crystal Palace_h ... Swansea_a Swansea City_a Tottenham_a Tottenham Hotspur_a Watford_a West Bromwich Albion_a West Ham_a West Ham United_a Wigan_a Wolverhampton Wanderers_a
3117 12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3116 12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3119 12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3124 12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3125 12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
  • 예측은 홈팀의 승/무/패에 대해서만 진행
  • 실제결과와 예측값을 통해 예측 정확도 측정

  • 예측은 여러가지 예측기법을 통해 수행하며 각 예측기법의 성능 평가


 
# 홈팀의 승/무/패 결정
def determine_home_result(match):
if match['home_team_goal'] > match['away_team_goal']:
return 'win'
elif match['home_team_goal'] < match['away_team_goal']:
return 'lose'
else:
return 'draw'


full_matches['home_team_result'] = full_matches.apply(determine_home_result, axis=1)

# 2016/2017 시즌 13 statge 이전까지를 훈련 데이터로 활용
train_matches = full_matches.loc[(full_matches['season'] != this_season) |
(full_matches['season'] == this_season) &
(full_matches['stage'] < this_week)].copy()

# 예측 변수 설정
targets = train_matches['home_team_result'].values
train_matches.tail()

match_id season stage date home_team_goal away_team_goal home_team away_team home_win home_draw home_lose away_win away_draw away_lose home_team_result
3117 6111 2016/2017 12 42693 1 2 Crystal Palace Manchester City 0 0 1 1 0 0 lose
3116 6110 2016/2017 12 42693 1 1 Manchester United Arsenal 0 1 0 0 1 0 draw
3119 6113 2016/2017 12 42693 0 0 Southampton Liverpool 0 1 0 0 1 0 draw
3124 6118 2016/2017 12 42694 0 1 Promoted Chelsea 0 0 1 1 0 0 lose
3125 6119 2016/2017 12 42695 4 0 West Bromwich Albion Promoted 1 0 0 0 0 1 win
# 2016/2017 13 스테이지 예측 (검증)
test_match_features = full_match_features.loc[(full_match_features['season'] == this_season) &
(full_match_features['stage'] == this_week)].copy()

test_match_features.drop(['season'], axis=1, inplace=True)
test_match_features

stage Arsenal_h Aston Villa_h Birmingham_h Blackburn_h Bolton_h Bournemouth_h Cardiff_h Chelsea_h Crystal Palace_h ... Swansea_a Swansea City_a Tottenham_a Tottenham Hotspur_a Watford_a West Bromwich Albion_a West Ham_a West Ham United_a Wigan_a Wolverhampton Wanderers_a
3126 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3127 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
3128 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3129 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3130 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3131 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 ... 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
3134 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0
3132 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3133 13 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3135 13 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
 
model_test_matches = full_matches.loc[(full_matches['season'] == this_season) & 
(full_matches['stage'] == this_week)].copy()

model_test_matches = model_test_matches.reset_index(drop=True)
model_test_matches

match_id season stage date home_team_goal away_team_goal home_team away_team home_win home_draw home_lose away_win away_draw away_lose home_team_result
0 6120 2016/2017 13 42700 1 2 Promoted Manchester City 0 0 1 1 0 0 lose
1 6121 2016/2017 13 42700 1 1 Promoted West Bromwich Albion 0 1 0 0 1 0 draw
2 6122 2016/2017 13 42700 2 2 Leicester City Promoted 0 1 0 0 1 0 draw
3 6123 2016/2017 13 42700 2 0 Liverpool Sunderland 1 0 0 0 0 1 win
4 6124 2016/2017 13 42700 5 4 Swansea City Crystal Palace 1 0 0 0 0 1 win
5 6125 2016/2017 13 42700 2 1 Chelsea Tottenham Hotspur 1 0 0 0 0 1 win
6 6128 2016/2017 13 42701 1 1 Manchester United West Ham United 0 1 0 0 1 0 draw
7 6126 2016/2017 13 42701 0 1 Watford Stoke City 0 0 1 1 0 0 lose
8 6127 2016/2017 13 42701 3 1 Arsenal Bournemouth 1 0 0 0 0 1 win
9 6129 2016/2017 13 42701 1 0 Southampton Everton 1 0 0 0 0 1 win
 
def predict_home_result(match):
if (match['win'] >= match['draw']) & (match['win'] >= match['lose']):
return 'win' # Favour a home win if probability equal
elif (match['lose'] > match['win']) & (match['lose'] > match['draw']):
return 'lose'
else:
return 'draw'


  • 분석기법은 본 튜토리얼에서 활용한 MultinomialNB에 더하여 랜덤포레스트, 가우시안, 로지스틱 회귀 기법 총 4가지를 수행

  • 각 기법들이 테스트 데이터에 대해서 어떻게 예측 했는지를 출력하고 해당값과 실제값을 비교하여 정확도를 그래프로 산출

  • 첫줄에 언급한 순서대로 0.4 / 0.4 / 0.5 / 0.4로 성능이 나타났음

# MultinomialNB
model = MultinomialNB()

model.fit(train_match_features.values, targets)

predicted = model.predict_proba(test_match_features.values)

predicted_table = pd.DataFrame(predicted,columns=['draw', 'lose', 'win'])

 
# 가우시안 Naive Bayesian
model_GNB = GaussianNB()
GNB_predicted = model_GNB.fit(train_match_features.values, targets).predict(test_match_features.values)
print(GNB_predicted)

predicted_table['GNB_predict'] = GNB_predicted

# 랜덤포레스트
model_RFC = RandomForestClassifier(n_estimators = 100)
RFC_predicted = model_RFC.fit(train_match_features.values, targets).predict(test_match_features.values)

print(RFC_predicted)

 

# 로지스틱 회귀
model_LR = linear_model.LogisticRegression(random_state=1234) # 1234는 seed값
LR_predicted = model_LR.fit(train_match_features.values, targets).predict(test_match_features.values)
print(LR_predicted)

predicted_table['actual_res'] = model_test_matches['home_team_result']
predicted_table['predict_res'] = predicted_table.apply(predict_home_result, axis=1)
predicted_table['GNB_predict'] = GNB_predicted
predicted_table['RFC_predicted'] = RFC_predicted
predicted_table['LR_predicted'] = LR_predicted

print(accuracy_score(model_test_matches['home_team_result'], predicted_table['predict_res']))
tmp1 = accuracy_score(model_test_matches['home_team_result'], predicted_table['predict_res'])

print(accuracy_score(model_test_matches['home_team_result'], GNB_predicted))
tmp2 = accuracy_score(model_test_matches['home_team_result'], GNB_predicted)

print(accuracy_score(model_test_matches['home_team_result'], RFC_predicted))
tmp3 = accuracy_score(model_test_matches['home_team_result'], RFC_predicted)

print(accuracy_score(model_test_matches['home_team_result'], LR_predicted))
tmp4 = accuracy_score(model_test_matches['home_team_result'], LR_predicted)

#Set graph format
sns.set_style("whitegrid")
sns.set_context("paper", font_scale = 1, rc={"lines.linewidth": 1})
ax = plt.subplot(111)
w = 0.5
x = np.arange(4)
ax.set_yticks(x + w)
names = []

test_scores = [tmp1, tmp2, tmp3, tmp4]

#Plot all names in horizontal bar plot
ax.set_yticklabels((['Multinomial NB','Gaussian NB','Random Forest','Logistic Regression']))
plt.xlim(0.0, 0.55)
plt.barh(x, test_scores, color = 'b', alpha = 0.6)
plt.title("Test Data Accuracy Scores")
fig = plt.figure(1)

plt.show()




  • Random Forest의 예측률이 0.5로 가장 좋은 성능을 보임

  • 훈련데이터가 기존의 홈팀과 어웨이팀에 따라 승리를 예측한 것이기 때문에 기법마다 예측률이 낮게 나옴

  • 승/무/패 정보를 모두 통합하여 모델을 생성하면 더 높은 정확도를 보일것으로 예상


 
compare_results = model_test_matches[['match_id', 'stage', 'home_team_goal', 
'away_team_goal', 'home_team', 'away_team']].copy()
compare_results.rename(columns={'home_team_goal':'h_goal', 'away_team_goal':'a_goal'}, inplace=True)
compare_results = pd.concat([compare_results, predicted_table], axis=1)
compare_results


match_id stage h_goal a_goal home_team away_team draw lose win actual_res predict_res GNB_predict RFC_predicted LR_predicted
0 6120 13 1 2 Promoted Manchester City 0.229245 0.585717 0.185038 lose lose lose lose lose
1 6121 13 1 1 Promoted West Bromwich Albion 0.322653 0.378717 0.298630 draw lose lose draw lose
2 6122 13 2 2 Leicester City Promoted 0.276192 0.114536 0.609272 draw win draw win win
3 6123 13 2 0 Liverpool Sunderland 0.280019 0.085162 0.634819 win win win draw win
4 6124 13 5 4 Swansea City Crystal Palace 0.320864 0.639668 0.039467 win lose lose draw lose
5 6125 13 2 1 Chelsea Tottenham Hotspur 0.694610 0.202862 0.102527 win draw draw win draw
6 6126 13 0 1 Watford Stoke City 0.379175 0.239934 0.380891 lose win draw draw win
7 6127 13 3 1 Arsenal Bournemouth 0.292823 0.092231 0.614945 win win draw win win
8 6128 13 1 1 Manchester United West Ham United 0.021082 0.070367 0.908550 draw win win win win
9 6129 13 1 0 Southampton Everton 0.380939 0.236972 0.382089 win win win win draw
10 6120 13 1 2 Promoted Manchester City 0.229245 0.585717 0.185038 lose lose lose lose lose
11 6121 13 1 1 Promoted West Bromwich Albion 0.322653 0.378717 0.298630 draw lose lose draw lose
12 6122 13 2 2 Leicester City Promoted 0.276192 0.114536 0.609272 draw win draw win win
13 6123 13 2 0 Liverpool Sunderland 0.280019 0.085162 0.634819 win win win draw win
14 6124 13 5 4 Swansea City Crystal Palace 0.320864 0.639668 0.039467 win lose lose draw lose
15 6125 13 2 1 Chelsea Tottenham Hotspur 0.694610 0.202862 0.102527 win draw draw win draw
16 6126 13 0 1 Watford Stoke City 0.379175 0.239934 0.380891 lose win draw draw win
17 6127 13 3 1 Arsenal Bournemouth 0.292823 0.092231 0.614945 win win draw win win
18 6128 13 1 1 Manchester United West Ham United 0.021082 0.070367 0.908550 draw win win win win
19 6129 13 1 0 Southampton Everton 0.380939 0.236972 0.382089 win win win win draw
20 6120 13 1 2 Promoted Manchester City 0.229245 0.585717 0.185038 lose lose lose lose lose
21 6121 13 1 1 Promoted West Bromwich Albion 0.322653 0.378717 0.298630 draw lose lose draw lose
22 6122 13 2 2 Leicester City Promoted 0.276192 0.114536 0.609272 draw win draw win win
23 6123 13 2 0 Liverpool Sunderland 0.280019 0.085162 0.634819 win win win draw win
24 6124 13 5 4 Swansea City Crystal Palace 0.320864 0.639668 0.039467 win lose lose draw lose
25 6125 13 2 1 Chelsea Tottenham Hotspur 0.694610 0.202862 0.102527 win draw draw win draw
26 6126 13 0 1 Watford Stoke City 0.379175 0.239934 0.380891 lose win draw draw win
27 6127 13 3 1 Arsenal Bournemouth 0.292823 0.092231 0.614945 win win draw win win
28 6128 13 1 1 Manchester United West Ham United 0.021082 0.070367 0.908550 draw win win win win
29 6129 13 1 0 Southampton Everton 0.380939 0.236972 0.382089 win win win win draw