Hi folks - I am just learning Julia as I want to use TreeGP in Evolutionary. The code at SymbolicRegression.ipynb works fine right up to this bit ==>
Random.seed!(987498737423);
res = Evolutionary.optimize(fitobj,
TreeGP(50, Terminal[syms…], funcs,
mindepth=1,
maxdepth=4,
optimizer = GA(
selection = uniformranking(5),
ɛ = 0.1,
mutationRate = 0.95,
crossoverRate = 0.05,
),
)
)
which it pukes up as below. I don’t understand. How does this not work? - it’s the basic example code. It tells me “optimizer” is not an argument. Thanks for any help.
here’s the errors ==>
MethodError: no method matching TreeGP(; populationSize=50, terminals=Dict(:x => 1), functions=Dict{Function, Int64}((-) => 2, (/) => 2, (*) => 2, (+) => 2), mindepth=1, maxdepth=4, optimizer=GA[P=50,x=0.05,μ=0.95,ɛ=0.1])
Closest candidates are:
TreeGP(; populationSize, terminals, functions, mindepth, maxdepth, crossover, mutation, selection, crossoverRate, mutationRate, initialization, simplify, metrics) at util.jl:453 got unsupported keyword argument “optimizer”
TreeGP(::Integer, ::Vector{Union{Function, Real, Symbol}}, ::Vector{Function}; kwargs…) at /Users/sabel/.julia/packages/Evolutionary/65hL6/src/gp.jl:40
TreeGP(::Integer, ::Dict{Union{Function, Real, Symbol}, Int64}, ::Dict{Function, Int64}, ::Int64, ::Int64, ::Function, ::Function, ::Function, ::Real, ::Real, ::Symbol, ::Union{Nothing, Function}, ::Vector{ConvergenceMetric}) at /Users/sabel/.julia/packages/Evolutionary/65hL6/src/gp.jl:26 got unsupported keyword arguments “populationSize”, “terminals”, “functions”, “mindepth”, “maxdepth”, “optimizer”
…
Stacktrace:
[1] kwerr(kw::NamedTuple{(:populationSize, :terminals, :functions, :mindepth, :maxdepth, :optimizer), Tuple{Int64, Dict{Symbol, Int64}, Dict{Function, Int64}, Int64, Int64, GA{Evolutionary.var"#uniformrank#246"{Evolutionary.var"#uniformrank#245#247"{Int64}}, typeof(Evolutionary.genop), typeof(Evolutionary.genop)}}}, args::Type)
@ Base ./error.jl:157
[2] TreeGP(pop::Int64, term::Vector{Union{Function, Real, Symbol}}, func::Vector{Function}; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:mindepth, :maxdepth, :optimizer), Tuple{Int64, Int64, GA{Evolutionary.var"#uniformrank#246"{Evolutionary.var"#uniformrank#245#247"{Int64}}, typeof(Evolutionary.genop), typeof(Evolutionary.genop)}}}})
@ Evolutionary ~/.julia/packages/Evolutionary/65hL6/src/gp.jl:43
[3] top-level scope
@ In[15]:2
[4] eval
@ ./boot.jl:360 [inlined]
[5] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:1116