Fixtures.csv files have team_a and team_h swapped!
Closed this issue · 8 comments
I'm working on building out a CNN and some other models using this FPL data, and was feature engineering a 'matchup difficulty' feature and seeing some weird behavior. Tracing things backwards, I realized all the fixtures.csv files have team_a and team_h backwards! team_h and team_a_difficulty match up, but not V/V
Hmm, I don't think that's true, at least for the current season. I just checked the latest fixtures.csv and it seems to have it correct.
Can you point me to a specific, detailed example where the team_a and team_h have been swapped?
Sure, I'm seeing the issue in 2020-21, and 2021-22 (which are the years I'm using for my NN)
Maybe I'm misunderstanding something?
I'm seeing the same thing in 2023-23, where if I sortby 'team_a', the 'team_a_difficulties' are all jumbled, but the team_h_difficulties
match up as I would expect. ie. if team_a is Man City, we see team_h_difficulty = 5 consistently, but team_a_difficulty is a bunch of different values.
team_a_difficulty should be a bunch of different values as for Man City the fixture rating will heavily depend on the team they are facing.
For example, Man City's difficulty rating for Liverpool Away would be 5; but for something like Luton Away it would most likely be 2.
Totally agree with that, but the team_a_difficulty should match up with the team_a ID value right? This is what I was trying to describe:
If we sort by the team_a ID (so this is a bunch of games where away team = team_a), then the team_h_difficulty becomes fixed, but the team_a_difficulties vary.
![Screenshot 2023-12-06 at 9 21 45 AM](https://private-user-images.githubusercontent.com/72712014/288492985-a30725f7-8ca5-4d15-8669-68b5e42af0c0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3NzcyNjksIm5iZiI6MTcyNTc3Njk2OSwicGF0aCI6Ii83MjcxMjAxNC8yODg0OTI5ODUtYTMwNzI1ZjctOGNhNS00ZDE1LTg2NjktNjhiNWU0MmFmMGMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA4VDA2MjkyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlY2NjMTkyMTQ5YTc4NGJkN2U0ZGMxNmJiYTU0NDVhYzI4NzMyZmQ2MWU2NWQxMzk5NDVmZGRiMDRmMzFmMmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8erUD-f29FwVjOxoObsvrSHDzFYoPYsMQ7GKwTNeDrI)
Same thing for sorting by the home team:
![Screenshot 2023-12-06 at 9 24 19 AM](https://private-user-images.githubusercontent.com/72712014/288493490-2b19bdbe-bab5-4fef-b382-9f207d6bab8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3NzcyNjksIm5iZiI6MTcyNTc3Njk2OSwicGF0aCI6Ii83MjcxMjAxNC8yODg0OTM0OTAtMmIxOWJkYmUtYmFiNS00ZmVmLWIzODItOWYyMDdkNmJhYjhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA4VDA2MjkyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYxNTljNTNlMjdhZTk3OTUxMTFkMzM3NjZiZjJhMjc0MmE1NjljNDNiMDExYzdlNTU1ZjUxNTUwNWJhNmE0ZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hePr36SjDACi_ZGCuaObVAa18csu3UAikY4mBgiJoQQ)
Wait a second... is the intention of these columns that 'team_h_difficulty' tells you how difficult the opponent team is for team h (ie. team_h_difficulty tells you how hard the AWAY team (team_a) is today for the home team?).
I was expecting the opposite from the column titles (ie. team_a_difficulty) tells you how difficult team_a is.
team_h_difficulty is telling you the fixture difficulty rating for the home team (i.e. how difficult the away team is for the home team).
team_a_difficulty is telling you the fixture difficulty rating for the away team (i.e. how difficulty the home team is for the away team).
This encoding is directly from the official FPL API.
Got it, all good then. Thanks for clarifying. Might be worth adding a small note in the README?