bradfordboyle / python-projects

Collection of different utility projects written in python
MIT License
2 stars 1 forks source link

Fantasy Football LP Model with standalone data #1

Closed neufeldtech closed 7 years ago

neufeldtech commented 7 years ago

Hi, I found your fantasy-football project and am interested try it out with my own data. I've attempted to run the lp_solve command with some sample data but am running into issues. Would you be able to let me know what is necessary to be able to run this project as "standalone" (without scraping Yahoo, CBS, etc). The command that I tried was the following (I realise I'm probably missing the total salary cap constraint, and possibly other data, but am not sure where these params need to be injected).

test_dataset1.csv sample (100 rows)

12,78674,"Stuart, Jenette",Seattle Seahawks,RB
37,59343,"Alston, Benjamin",San Francisco 49ers,TE
65,66073,"Gray, Pandora",Green Bay Packers,RB
19,91974,"Wade, Tana",Indianapolis Colts,K
78,93150,"Schmidt, Rachel",Carolina Panthers,DST
8,72043,"Carver, Sasha",Miami Dolphins,TE
79,87419,"Webb, Kaseem",Jacksonville Jaguars,RB
47,78719,"Alvarez, Delilah",Baltimore Ravens,WR
36,95473,"Murphy, Clayton",St. Louis Rams,QB
....

Building the model $ ./BuildLPModel.py --file files/test_dataset1.csv >! files/test_dataset1.lp

Running the model

$ lp_solve -S2 < files/test_dataset1.lp
This problem is infeasible

Any assistance that you can provide would be greatly appreciated. Thank you.

bradfordboyle commented 7 years ago

Looking at the sample data you pasted, it looks like the salaries are much higher than BuildLPModel.py expects. Try changing the upper bound on team salary in line 58.

neufeldtech commented 7 years ago

@bradfordboyle That solved my issue, thanks!