chanzer0 / nba-dfs-tools Goto Github PK
View Code? Open in Web Editor NEWA set of NBA optimizers and GPP tools to help you win daily fantasy sports
A set of NBA optimizers and GPP tools to help you win daily fantasy sports
NBA-DFS-Tools/src/nba_optimizer.py
Lines 157 to 158 in 3528d76
i think we should pull np.random.normal() out of the lpSum constraint and instead include as a value in player_dict a pre-sampled array of length n lineups like:
player_dict[player]['fp_array'] = np.random.normal(self.player_dict[player]['Fpts'],
((self.player_dict[player]['StdDev']/self.player_dict[player]['Fpts'], size=num_lineups)
then under line 157 in the opto we would do
self.problem += plp.lpSum([p['fp_array'][i] for p in player_dict] * self.randomness_amount / 100))
(or whatever the correct syntax would be)
Hey, really cool code you have here? How exactly does your GPP process work like? I see from a quick glance that you essentially modify the optimal lineup? Is there any way I could reach out with more questions such as Twitter?
Not sure what I am doing wrong...any ideas?
PS C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src> python .\main.py dk opto 1 1
Traceback (most recent call last):
File "C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src\main.py", line 70, in
main(sys.argv)
File "C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src\main.py", line 28, in main
opto = NBA_Optimizer(site, num_lineups, num_uniques)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src\nba_optimizer.py", line 41, in init
self.load_projections(projection_path)
File "C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src\nba_optimizer.py", line 108, in load_projections
with open(path) as file:
^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src\../dk_data/projections.csv'
PS C:\Users\erose\Downloads\NBA-DFS-Tools-master\NBA-DFS-Tools-master\src>
Fanduel made changes this season for player position availability
Hey Chanzer, I love the idea of your tools and I am a huge DFS fan whos been looking for a tool like this, specifically the excel sheet that shows optimal, top 10% win% etc, However I keep getting an error when I am trying to run optimal lineups to receive outputs that show those stats. The following message keeps occurring : PS C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src> python .\main.py dk opto 1000 0 rand
Traceback (most recent call last):
File "C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src\main.py", line 63, in
main(sys.argv)
File "C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src\main.py", line 21, in main
opto = NBA_Optimizer(site, num_lineups, num_uniques)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src\nba_optimizer.py", line 36, in init
self.load_config()
File "C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src\nba_optimizer.py", line 60, in load_config
with open(os.path.join(os.path.dirname(file), '../config.json'), encoding='utf-8-sig') as json_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src\../config.json'
PS C:\Users\colin\OneDrive\Desktop\NBA-DFS-Tools-master\src>
Is there an issue with my JSON file? And would there be a code I could input that would allow for me to input my lineups, and receive the output in the excel sheet? Sorry if all of these questions are ridiculous but thank you so much for all you do!
Have you thought about expanding to all sports, and creating a GUI.
Also, I think it would be cool to have a db of FanDuel contest history. To see what top players are doing day to day. I know fantasy cruncher has rewind for DK, but nothing for FD since they done make csv’s of contests available. So you will need to scrape contest data from FD. I think this could be huge. If you want help let me know I started attempting this but it def needs upgrades.
Getting this error...lineup optimizer works gpp simulator doesn't.
Love your simulator but it seems like you have a bug with hyphenated players in FD (Luwawu-Cabarrot and Anthony-Towns tonight for example). It optimizes with them but includes them as zeroes across the board except for 0.1% for ownership.
Hi,
I'm a FD player and had some questions about the gpp sim process.
I appreciate your time in responding! Awesome tool.
Where do you get the player data needed in CSV on fanduel?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.