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: DimensionMismatch #3

Open xiru3kfa opened 6 years ago

xiru3kfa commented 6 years ago

Can anyone help me with this error? Full text below, and Line 44 string beneath:


ERROR LANGUAGE


LoadError: DimensionMismatch("mismatch in dimension 1 (expected 1 got 671)") Stacktrace: [1] _cs(::Int64, ::Bool, ::Int64, ::Int64) at ./abstractarray.jl:1193 [2] _cshp at ./abstractarray.jl:1189 [inlined] [3] cat_shape(::Tuple{Bool,Bool}, ::Tuple{Int64,Int64}, ::Tuple{Int64}) at ./abstractarray.jl:1170 (repeats 2 times) [4] cat_t(::Type{T} where T, ::Type{T} where T, ::Void, ::Vararg{Any,N} where N) at ./abstractarray.jl:1203 [5] hcat(::Void, ::Array{Int64,1}) at ./abstractarray.jl:1301 [6] create_lineups(::Int64, ::Int64, ::Int64, ::#baseball_formulation, ::String, ::String, ::String) at /Users/NAME/Desktop/GitHub_MLB_Code/data_cleaning.jl:439 [7] include_from_node1(::String) at ./loading.jl:576 [8] include(::String) at ./sysimg.jl:14 while loading /Users/NAME/Desktop/GitHub_MLB_Code/optimize_multiple_lineups_baseball.jl, in expression starting on line 44


Line 44 string:


create_lineups(num_lineups, num_overlap, stack_size, formulation, path_pitchers, path_hitters,  path_to_output);
telapsed = toq();

println("\nCalculated DraftKings baseball lineups.\n\tNumber of lineups = ", num_lineups, " \n\tStack size = ",stack_size,
"\n\tOverlap = ", num_overlap,"\n" )

println("Took ", telapsed/60.0, " minutes to calculate ", num_lineups, " lineups")

println("Saving data to file ",path_to_output,"\nDK Mafia 4 life")
jnederlo commented 6 years ago

It looks like your inputs to create_lineups are off and the solver can't work with the data. It's really hard to tell though. Try looking at your inputs before they go into create_lineups() and make sure that they are as they should be.