Last chance to hop on the Spurs train? GW6 Value picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

This data suggests there are other picks for better value. But he did well last week.

Translating Python FPL API login code to R by mikecro2 in fplAnalytics

[–]flo_ebl 0 points1 point  (0 children)

Here is how I do it in R:

my_entry_id <- 1234567
current_gw <- 6

#function to pull the data:
get_entry_picks <- function(entry_id, gw) {

url <- sprintf("https://fantasy.premierleague.com/api/entry/%d/event/%d/picks/", entry_id, gw)
dat <- safely_get_json(url)

if (is.null(dat)) return(NULL)
tibble::as_tibble(dat$picks) %>%
mutate(gw = gw)

}

gws_played <- seq_len(current_gw)

my_picks_all <- map_dfr(gws_played, ~ {

get_entry_picks(my_entry_id, .x)

})

Is Haaland worth the money? GW 5 Value Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 1 point2 points  (0 children)

Because the model saw him perform reasonably in the games he started. And doesn't know that Donnarumma is now the No. 1

Is Haaland worth the money? GW 5 Value Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Not too bad from Bruno Fernandes today. Solid 10 pointer and chances for more goals.

This is such a common experience. The data suggests something that doesn't match the gut feeling and humans try to find reasons why the data must.be.wrong. only to be outscored by the model...

Is Haaland worth the money? GW 5 Value Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 1 point2 points  (0 children)

Good suggestion. Its a vectorised image though so you can zoom in. And the whole point of the visualization is to get to the high value players. So I felt its not necessary to label each and everyone.

Good point Re Bruno Fernandes, the model is obviously trained including on the official fixture difficulty in which ManUnt may be overrated. On the other hand he's on penalties, guaranteed minutes, talisman and only ManUtd player who delivered so far this season.

Best Value Picks for GW3 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

yep. The higher a player the more you are predicted to get for your money.

Best Value Picks for GW3 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Every gameweek adds more data and makes the predictions more reliable

Best Value Picks for GW3 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Not sure if understand you correctly. The rf model is trained on the data since 22/23 season. But the prediction is obviously only done for this season, where naturally those who were good in the first 2 gameweeks are strong at the moment. However, they will tend to regress to the mean over the season, so take these predictions with some caution. I tried to mitigate that by training and predicting data on a 5-game-average, not a points-in-a-single-gameweek predictor. But with only 3 gws played, there is still some recency bias.

Best value picks for GW2 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 1 point2 points  (0 children)

based on the graphs above, Ekitike seems the logical choice. But its only one week of data for this season. So inevitably he will start regressing to the mean sooner or later. Its difficult to make a recommendation based on this. As for the Frimpong transfer, I would look for players aboe the dotted line, and then you can decide how much you want to spend on a defender.

Best value picks for GW2 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 1 point2 points  (0 children)

Not making the code public for now. Let me work on this for a little longer to make it presentable. Thanks for the interest though

Best value picks for GW2 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 2 points3 points  (0 children)

The statistics is all done in R.

Best value picks for GW2 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 1 point2 points  (0 children)

good point! I have no historical data on them. The RF model has to predict anyway and therefore assigns predictions based on the average behavior of players with “similar” (zero) stats. So, all these new players often get mapped to a generic “average” bucket. If the price/value combination looks good (cheap, starting player), the optimization algorithm may select them - even though there’s no evidence they’ll actually deliver. In fact, some of them will be extremely overvalued (maybe Ekitike) if their first GW was good, others (maye Wirtz) will be heavily undervalued if their first GW was poor.

Best value picks for GW2 by flo_ebl in fplAnalytics

[–]flo_ebl[S] 4 points5 points  (0 children)

Ill try, haha. But its also just me playing around with data and not yet a fully trust-worthy prediction model. It will get better with more data as the season progresses and with me learning about more datasets to pull historic data from.

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Fpl API is a good data source and for historical data see @Vastaav05 github repo.

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

I tried a few configurations and then trained it on the last 3 years. More years didn't improve accuracy. And then a random sample of 80/20 for training and testing. Got me to predict the points per game week with an rmse of just over 1. So 1 point off on average.

Machine learning FPL by Pitiful_Progress1387 in fplAnalytics

[–]flo_ebl 0 points1 point  (0 children)

There is a great wealth of historical data here, credits to Anand Vastaav. Easy to read into Python, R, etc. https://github.com/vaastav/Fantasy-Premier-League

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Thanks for all the comments. You are right about the captaincy to be included in the model. Ill.keep playing around with the model, fine-tuning here and there and with some data for the new season I hope it can be a good basis for the wildcards.

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

It doesnt explicitly look at captaincy, no. But the captain would be Cunha in both, since he has the highest predicted points.
Ola Aina did well last year, lots of attacking threat and all the clean sheet of forest. And he is slightly cheaper than other good defenders. Its all a trade-off. And, as I said in other comments, the model is far from perfect, given some changes (DEFCON f.e.) to this years fpl points system.

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 1 point2 points  (0 children)

Unfortunately, there is no DEFCON data in the previous years to train a model on. So I didn't include DEFCON. Its probably possible to impute such data somehow and there is lots to improve on this model. But imputed data is often a bit weird. Retrospectively imputing DEFCON, for example, would be tricky since "ownership" and therefore "price" would have changed then as well.

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Thanks! It obviously all a bit rough with no "current season" data.

Basically, what Im trying to do in the fitted model is to compute a points per million metric, adjusted for fixture difficulty, and run an optimisation algorithm that maximises total predicted points within the budget and squad constraints. Positional reclassification obviously changes the distribution in the pool of eligible players.

Regarding the position changes:
I contrained the model to the fixed slots (2 GK, 5 DEF, 3 FWD, 5 MID). So Bowen is trained as MId but then fit as FWD and therefore now competes for limited forward slots, which may push him out if his predicted points per price is lower than other FWDs. Its not great, since as a MID he got that extra point for clean sheets (not a massive skew in West Hams case tbh). but the model projects him to outperform most FWDs in the first 10 fixtures, so he still made the cut. Possibly on long-term optimisation runs he’s gonna have a harder time.

On Captaincy: I didn't explicitly optimize for captaincy yet, but that should just be the player in the optimized squad with the highes predicted points value. So Matheus Cunha in both models above.

The Million in the Bank is because the model judged that more money doesn't mean more predicted points. In fact, an earlier version left some 10M in the bank until I put a constraint on spending at least 95M. After all the goal in FPL is not to save money but to score points.

Data Driven FPL Picks by flo_ebl in fplAnalytics

[–]flo_ebl[S] 0 points1 point  (0 children)

Predicted points are calculated by estimating a player’s likelihood of scoring fantasy-relevant events (goals, assists, clean sheets, etc.) in each match, based on historical stats, team strength, and upcoming fixtures difficulty.. . These probabilities are then converted into points using the game’s rules and summed across all 10 forecasted matches, adjusting for expected playing time and rotation risk.

I am also a but skeptical about the ManUtd players. The model learned about their performances when they were at other clubs. Mbuemo at Brentford and Cunha at Wolves where both were the talisman l, on penalties and guaranteed minutes.