dfs-with-r / coach

Lineup optimization for daily fantasy sports
https://dfs-with-r.github.io/coach/
GNU General Public License v3.0
46 stars 14 forks source link

Stacking in NFL #32

Open megamax617 opened 2 years ago

megamax617 commented 2 years ago

Evening! Amazing tool, its a major help! i am a novice to R but i have been able to navigate a bit, but i am having trouble figuring out the stacking, or how to set it up. E.g. stacking Qb and WR and then doing a bring back. How would i go about achieving this. I saw that there is a an operator (not sure if this is right term) for mlb but cant find the one for NFL.

I have a question on showdown too, but i figured i would start with the stacking.

Thank you again, your efforts are truly appreciated.

christianlohr9 commented 2 years ago

Are there any thoughts on solving this issue? Because that'd be a fkn game changer ❤️

Love the package, but I have no idea how to add this by myself^^

zamorarr commented 2 years ago

Hi there. Yes you can do stacking, but unfortunately it is not by position right now. When optimizing you just have to specify the stack sizes and teams you want to stack from (or leave empty for all teams). For example,

 optimize_generic(data, model, L = 10, stack_sizes = c(3, 2), stack_teams = c("DAL", "HOU", "WAS"))

would create stacks of 3-2 using players from Dallas, Houston, and Washington (or whatever teams you want). I would definitely like to add positional stacking but I have less and less time these days. I'll try to get to it at some point.Happy to review a pull request from someone else until then!