zlisto / Daily-Fantasy-Baseball-Contests-in-DraftKings

This is the code for constructing a portfolio of lineups for DraftKings baseball contests with a top heavy payoff structure. This code is based on the paper Picking Winners Using Integer Programming by David Hunter, Juan Pablo Vielma, and Tauhid Zaman (https://arxiv.org/abs/1604.01455).
37 stars 27 forks source link

ERROR: LoadError: UndefVarError: DataArrays not defined #2

Open mjk0s1ba opened 6 years ago

mjk0s1ba commented 6 years ago

Can anyone help me with this error code?

jnederlo commented 6 years ago

@mjk0s1ba

DataArrays is a package. So to fix the error first you need to run

Pkg.add("DataArrays")

in Julia, then in the data_cleaning.jl file you need to add the following to the top of the document

using DataArrays

That should solve your issue.

mjk0s1ba commented 6 years ago

Thank you. That got me further along, but still got an error on the output. The way I finally got it to work was to comment out some of the output variables. See below:

path_to_output= #=string(string(formulation), "stacksize", stack_size,"overlap", num_overlap,"lineups", num_lineups,=#"C:/Users/Michael/.julia/mlb/output.csv";

path_to_output_proj = #=string("projbaseball", string(formulation), "stacksize", stack_size,"overlap", num_overlap,"lineups", num_lineups,=#"C:/Users/Michael/.julia/mlb/output_proj.csv";

path_to_output_actual = #=string("actualbaseball", string(formulation), "stacksize", stack_size,"overlap", num_overlap,"lineups", num_lineups,=#"C:/Users/Michael/.julia/mlb/output_actual.csv";

escism commented 6 years ago

@mjk0s1ba I'm not sure on PC how it works but I have my folders saved outside of the julia install and it looks like this in my code:

path_pitchers = "/Users/escism/Desktop/DFS/Baseball/2016-08-12 pitchers.csv" path_hitters = "/Users/escism/Desktop/DFS/Baseball/2016-08-12 hitters.csv";

escism commented 6 years ago

@jnederlo Thank you for the Using DataArrays, that got me to the next error which says:

ERROR: LoadError: Invalid Gurobi license

I have looked at the baseball_formulations.jl file and tried to comment out the Using Gurobi code on line 20, but that doesne't seem to make a difference. Any add'l guidance would greatly appreciated!

jnederlo commented 6 years ago

@escism you have to comment out line 40, not line 20, but no harm in commenting out line 20 either.

`#uncomment this line only if you are using Gurobi, which costs money :(), but is super fast :)

m = Model(solver=GurobiSolver(OutputFlag=0))`

escism commented 6 years ago

@jnederlo Excellent! Thanks for the update now it ran perfectly!

amacleay commented 5 years ago

@escism @jnederlo if you still have this working, could you please comment in #8 with what versions of the packages you are running? The output of Pkg.status() on a working instance would be super helpful. It seems as though the latest versions of these packages no longer play nice together. I have found that I must pin julia to 0.4.0 or a 0.6 version, and JuMP to 0.12.1, but still run into errors loading Calculus