Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to build custom model #41

Open
smellycat21 opened this issue Nov 13, 2022 · 3 comments
Open

trying to build custom model #41

smellycat21 opened this issue Nov 13, 2022 · 3 comments

Comments

@smellycat21
Copy link

Hey guys, trying to build this out for a custom model not currently available, is there a step by step into building my own?

thanks!

@zamorarr
Copy link
Collaborator

Hi @smellycat21. There is no guide for building your own custom model yet, but I can answer any questions you are having. You can also take a look at the source code for some of the models for inspiration: https://github.com/dfs-with-r/coach/blob/master/R/fanduel-nba.r

@smellycat21
Copy link
Author

thanks!

a few questions:

What is the easiest way to lock or remove a player from the pool in R?
Also is there a way to set a maximum exposure for certain players?
Is there a way to reduce the players projection after every lineup they've been selected in?
How does the randomness number compare to a %?

Sorry, I am new to this and im sure i will have more going fwd!

Really appreciate your help!

@zamorarr
Copy link
Collaborator

  1. To lock or ban a player from the pool, you can set the lock and ban parameters of the optimize_generic() function. For example, optimize_generic(data, model, bans = c(3, 10), locks = c(1,2)) would ban the 3rd and 10th players in the data and lock the 1st and 2nd.
  2. Similarly, you can set the max_exposure parameter` of the same function. It accepts either one value that will apply to every player, or a vector of values - one for each player. There is some more info in the README
  3. There is no way to reduce the projection after every lineup currently, though that might be a good feature to add in the future.
  4. The randomness parameter actually accepts a function that will be applied the fpts_proj column in the data. There is some more info in the README as well. So for example to add a random noise that is Normally distributed around the fpts_proj value, with a standard deviation of 10 you would do this:
n <- nrow(data)
my_fun <- function(x) rnorm(n, x, 10)
optimize_generic(data, model, randomness = my_fun)

Hope that helps get you started. Let me know if you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants