Example #1
0
    dict_abbrevs['Carolina'] = 'CAR'
    dict_abbrevs['St. Louis'] = 'STL'
    dict_abbrevs['NY Rangers'] = 'NYR'
    dict_abbrevs['New Jersey'] = 'N.J'
    dict_abbrevs['Dallas'] = 'DAL'
    dict_abbrevs['Florida'] = 'FLA'
    dict_abbrevs['Nashville'] = 'NSH'
    dict_abbrevs['Edmonton'] = 'EDM'
    dict_abbrevs['Anaheim'] = 'ANA'
    dict_abbrevs['Colorado'] = 'COL'
    dict_abbrevs['Winnipeg'] = 'WPG'
    dict_abbrevs['Columbus'] = 'COL'
    dict_abbrevs['Arizona'] = 'PHX'
    dict_abbrevs['NY Islanders'] = 'NYI'

    common_logger = get_logger(name="common_logger",
                               debug_log_file_name="common_logger.log")
    print("Debug will be written in {}".format(
        common_logger.handlers[1].baseFilename))

    coaches_evaluator = Coach_Evaluator(common_logger)
    # coaches_evaluator.evaluate_all_coaches(season_year_begin = 2012, teams_opt=None, n_games=2) # 10) # ['PHX'])
    grades = coaches_evaluator.read_and_display_coaches_evals()

    df = pd.DataFrame.from_csv(
        "/Users/luisd/Downloads/NHLAttendance2012-2013.csv")

    # add column with abbreviation
    def name2abbrev(name: str) -> str:
        a = name.split(" ")
        if len(a) > 2:
            key = ' '.join(a[:-1])
db_root = Config().data_dir  #This is the location of the Hockey database
# db_root     =   '/Users/younes_zerouali/Documents/Stradigi/Databases/Hockey'
# db_root     =   '/Users/luisd/dev/NHL_stats/data'
repoPbP = path.join(db_root, 'PlayByPlay')
repoPSt = path.join(db_root, 'PlayerStats/player')
repoModel = path.join(
    repoCode,
    'ReinforcementLearning/NHL/playerstats/offVSdef/Automatic_classification/MODEL_backup_trainedonallseasons_rankstatprediction'
)
repoModel = path.join(
    repoCode,
    'ReinforcementLearning/NHL/playerstats/offVSdef/Automatic_classification/MODEL_perceptron_1layer_10units_relu'
)
repoSave = None  #path.join(repoCode, 'ReinforcementLearning/NHL/playbyplay/data')

a_logger = get_logger(name="a_logger", debug_log_file_name="/tmp/a_logger.log")
print("Debug will be written in {}".format(a_logger.handlers[1].baseFilename))

# =======================
# ==== RETRIEVE INFOS

seasons = ut_find_folders(repoPbP)
# Prep containers
gmInfo = pd.DataFrame(columns=['allE', 'filtE'])

# Loop on seasons
print('Launching analysis\n')
for iS in seasons:

    print('\tAnalysing season %s (%i/%i): ' %
          (iS, seasons.index(iS) + 1, len(seasons)))
Example #3
0
from Utils.base import get_logger

global_logger = get_logger(name="global_logger",
                           debug_log_file_name="/tmp/global_logger.log")