This repository contains the source code for an optimizer model that evaluates a user's team and recommends optimal decision making regarding transfers and chip usage
2
stars
0
forks
source link
Create weighted average of player offensive data #9
In src/player_data_processing there is a function named cleanFBRefPlayerOffensiveData. This function cleans the consolidated FBRef player offensive data. Some players played for two teams in one season and thus have two separate lines of statistics for a given season. This is not ideal as when merging with consolidated match-log data it results in duplicated rows. Currently, I am handling wby taking the average of the separate lines of statistics for all columns after grouping by player and season. Ideally we would take a weighted average.
For implementation, refer to line 70 in player_data_processing.py
To accomplish this we need # of games played for the player per season which is available under the column "90s".
Completed with most recent push. For those wanting to try and do regardless in your own branches, check my implementation in the player_data_processing script.
In src/player_data_processing there is a function named cleanFBRefPlayerOffensiveData. This function cleans the consolidated FBRef player offensive data. Some players played for two teams in one season and thus have two separate lines of statistics for a given season. This is not ideal as when merging with consolidated match-log data it results in duplicated rows. Currently, I am handling wby taking the average of the separate lines of statistics for all columns after grouping by player and season. Ideally we would take a weighted average.
For implementation, refer to line 70 in player_data_processing.py
To accomplish this we need # of games played for the player per season which is available under the column "90s".