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
Problem running the code. MethodError: no method matching sum(::GenericAffExpr{Float64,VariableRef}; i=1:616) #15
When I run the code optimize_multiple_lineups_baseball.jl I get the following error:
MethodError: no method matching sum(::GenericAffExpr{Float64,VariableRef}; i=1:616) Closest candidates are: sum(::Any) at reduce.jl:511 got unsupported keyword argument "i" sum(::Any, !Matched::StaticArrays.StaticArray{var"#s171",T,N} where N where var"#s171"<:Tuple; dims) where T at C:\Users\VM.julia\packages\StaticArrays\l7lu2\src\mapreduce.jl:251 got unsupported keyword argument "i" sum(::Any, !Matched::AbstractArray; dims) at reducedim.jl:723 got unsupported keyword argument "i" ... macro expansion at rewrite.jl:227 [inlined] macro expansion at macros.jl:830 [inlined] baseball_formulation(::DataFrame, ::Array{Int64,2}, ::Int64, ::Int64, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Int64,2}, ::Array{Int64,2}, ::Array{Int64,2}, ::Array{Int64,2}) at baseball_formulations3.jl:64 create_lineups(::Int64, ::Int64, ::Int64, ::typeof(baseball_formulation), ::String, ::String, ::String) at data_cleaning3.jl:434 top-level scope at optimize_multiple_lineups_baseball3.jl:75 include_string(::Function, ::Module, ::String, ::String) at loading.jl:1088
I would greatly appreciate your help to move forward
Greetings