ratingslib.datasets.soccer module
This module includes all parameters and configuration for soccer. column names are based on football-data.co.uk data scheme.
Notes
The dictionary COLUMNS_DICT is based on football-data.co.uk data files for other data-source change dictionary values specify column names:
key is the variable name in code
value is the column_name
‘ITEM_I’: column name for home team
‘ITEM_J’: column name for away team
‘points_i’ : column name for home team goals
‘points_j’ : column name for away team goals
‘HS’ : column name for home team total shoots
‘AS’ : column name for away team total shoots
‘HST’ : column name of home team total shoots on target
‘AST’ : column name of away team total shoots on target
date column is written at the beginning of this module (DATE_COL var)
HS, AS, HST, AST columns below are used in:
ratingslib.ratings.markov.Markov
ratingslib.ratings.accurate.AccuRate
- parser_date_func(x)
- class championships
Bases:
object
Class for championship names
- PREMIERLEAGUE = 'EPL'
- ENG_1 = 'E1'
- ENG_2 = 'E2'
- ENG_3 = 'E3'
- ENG_CONF = 'ECONF'
- SCOTLAND_PS = 'SPS'
- SCOTLAND_1 = 'SC1'
- SCOTLAND_2 = 'SC2'
- SCOTLAND_3 = 'SC3'
- BUNDESLIGAS_1 = 'GBL1'
- BUNDESLIGAS_2 = 'GBL2'
- ITALY_A = 'IA'
- ITALY_B = 'IB'
- SPAIN_PREMERA = 'SPP'
- SPAIN_SEGUNDA = 'SPS'
- FRANCE_CHAMP = 'FRCH'
- FRANCE_2 = 'FR2'
- NETHERLANDS = 'NKPN'
- BELGIUM = 'BEL'
- PORTUGAL = 'PLIGA'
- TURKEY = 'TLIGI'
- GREECE_SL = 'GREK'
- class stats
Bases:
object
Class for soccer statistics, In this class all statistics can represented here.
TW : TOTAL WINS/NUMBER OF GAMES
TG : TOTAL GOALS/NUMBER OF GAMES
TS : TOTAL SHOOTS/NUMBER OF GAMES (for soccer)
TST : TOTAL SHOOTS TARGET/NUMBER OF GAMES (for soccer)
STATISTIC COLUMNS DICTIONARY
ITEM_I: column name of statistic for home team e.g. in football-data.co.uk the column for goals is FTHG.
ITEM_J: column name of statistic for away team e.g. in football-data.co.uk the column for goals is FTAG.
TYPE: {WIN, POINTS}
if type is WIN then compare if ITEM_I > ITEM_J or ITEM_J < ITEM_I
if type is POINTS then count points
for more information about the TYPE see the implementation of
ratingslib.ratings.methods.calc_items_stats()
PARAMS DICTIONARY FOR MARKOV RATING SYSTEMS
key = statistic name e.g. TW
value = dictionary where
VOTE : total votes (e.g. 10), then will be converted as weight.
ITEM_I: H: column name of statistic for home team e.g. in football-data.co.uk the column for goals is FTHG.
ITEM_J: column name of statistic for away team e.g. in football-data.co.uk the column for goals is FTAG.
METHOD:{‘VotingWithLosses’, ‘WinnersAndLosersVotePoint’, ‘LosersVotePointDiff’} for more information about the methods see
ratingslib.ratings.markov
module.- TW = 'TW'
- TG = 'TG'
- TS = 'TS'
- TST = 'TST'
- STATS_COLUMNS_DICT = {'TG': {'ITEM_I': 'FTHG', 'ITEM_J': 'FTAG', 'TYPE': 'POINTS'}, 'TS': {'ITEM_I': 'HS', 'ITEM_J': 'AS', 'TYPE': 'POINTS'}, 'TST': {'ITEM_I': 'HST', 'ITEM_J': 'AST', 'TYPE': 'POINTS'}, 'TW': {'ITEM_I': 'FTHG', 'ITEM_J': 'FTAG', 'TYPE': 'WIN'}}
- STATS_MARKOV_EQUAL_DICT = {'TG': {'ITEM_I': 'FTHG', 'ITEM_J': 'FTAG', 'METHOD': 'WinnersAndLosersVotePoint', 'VOTE': 10.0}, 'TS': {'ITEM_I': 'HS', 'ITEM_J': 'AS', 'METHOD': 'WinnersAndLosersVotePoint', 'VOTE': 10.0}, 'TST': {'ITEM_I': 'HST', 'ITEM_J': 'AST', 'METHOD': 'WinnersAndLosersVotePoint', 'VOTE': 10.0}, 'TW': {'ITEM_I': 'FTHG', 'ITEM_J': 'FTAG', 'METHOD': 'VotingWithLosses', 'VOTE': 10.0}}
- STATS_MARKOV_DICT = {'TG': {'ITEM_I': 'FTHG', 'ITEM_J': 'FTAG', 'METHOD': 'WinnersAndLosersVotePoint', 'VOTE': 8.0}, 'TS': {'ITEM_I': 'HS', 'ITEM_J': 'AS', 'METHOD': 'WinnersAndLosersVotePoint', 'VOTE': 4.0}, 'TST': {'ITEM_I': 'HST', 'ITEM_J': 'AST', 'METHOD': 'WinnersAndLosersVotePoint', 'VOTE': 6.0}, 'TW': {'ITEM_I': 'FTHG', 'ITEM_J': 'FTAG', 'METHOD': 'VotingWithLosses', 'VOTE': 10.0}}