ITADN

[BUG]: guesses no method matching SRRegressor, fail to replicate toy example

#541ClosedAlicecomma 创建于 2026-01-31
bug
A
Alicecommacommented
### What happened? Running [Toy example 11. Seeding search with initial guesses](https://ai.damtp.cam.ac.uk/symbolicregression/dev/examples#11.-Seeding-search-with-initial-guesses) in Pluto.jl: ``` using SymbolicRegression, MLJ X = randn(Float32, 6, 2048) y = @. sin(X[1, :] * X[2, :] + 0.1f0) + cos(X[3, :]) * X[4, :] + X[5, :] / (X[6, :] * X[6, :] + 1) model = SRRegressor( binary_operators=[+, -, *, /], unary_operators=[sin, cos], maxsize=35, niterations=35, guesses=["sin(x1 * x2) + cos(x3) * x4 + x5 / (x6 * x6 + 0.9)", #= can provide additional guesses here =#], batching=true, batch_size=32, ) mach = machine(model, X', y) fit!(mach) ``` Throws error (entered in "Relevant log output". Not sure why it prints the package version as v"0.0.0" either-- ### Version v"0.0.0" ### Operating System Windows ### Interface Other (specify below) ### Relevant log output ```shell MethodError: no method matching SymbolicRegression.MLJInterfaceModule.SRRegressor(; binary_operators::Vector{Function}, unary_operators::Vector{Function}, maxsize::Int64, niterations::Int64, guesses::Vector{String}, batching::Bool, batch_size::Int64) This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented. Closest candidates are: SymbolicRegression.MLJInterfaceModule.SRRegressor(; defaults, binary_operators, unary_operators, maxsize, maxdepth, expression_spec, populations, population_size, ncycles_per_iteration, elementwise_loss, loss_function, loss_function_expression, dimensional_constraint_penalty, parsimony, constraints, nested_constraints, complexity_of_operators, complexity_of_constants, complexity_of_variables, warmup_maxsize_by, adaptive_parsimony_scaling, operator_enum_constructor, mutation_weights, crossover_probability, annealing, alpha, tournament_selection_n, tournament_selection_p, early_stop_condition, batching, batch_size, dimensionless_constants_only, loss_scale, complexity_mapping, use_frequency, use_frequency_in_tournament, should_simplify, perturbation_factor, probability_negate_constant, skip_mutation_failures, optimizer_algorithm, optimizer_nrestarts, optimizer_probability, optimizer_iterations, optimizer_f_calls_limit, optimizer_options, should_optimize_constants, migration, hof_migration, fraction_replaced, fraction_replaced_hof, topn, timeout_in_seconds, max_evals, input_stream, turbo, bumper, autodiff_backend, deterministic, seed, verbosity, print_precision, progress, output_directory, save_to_file, bin_constraints, una_constraints, terminal_width, use_recorder, recorder_file, define_helper_functions, expression_type, expression_options, node_type, output_file, fast_cycle, npopulations, npop, niterations, parallelism, numprocs, procs, addprocs_function, heap_size_hint_in_bytes, worker_imports, logger, runtests, run_id, loss_type, selection_method, dimensions_type) got unsupported keyword argument "guesses" @ SymbolicRegression C:\.julia\packages\SymbolicRegression\L5TJa\src\MLJInterface.jl:73 SymbolicRegression.MLJInterfaceModule.SRRegressor(::Union{Nothing, VersionNumber}, ::Any, ::Any, ::Union{Nothing, Integer}, ::Union{Nothing, Integer}, ::Union{Nothing, SymbolicRegression.CoreModule.ExpressionSpecModule.AbstractExpressionSpec}, ::Union{Nothing, Integer}, ::Union{Nothing, Integer}, ::Union{Nothing, Integer}, ::Union{Nothing, Function, LossFunctions.Traits.SupervisedLoss}, ::Union{Nothing, Function}, ::Union{Nothing, Function}, ::Union{Nothing, Real}, ::Union{Nothing, Real}, ::Any, ::Any, ::Any, ::Union{Nothing, Real}, ::Union{Nothing, Real, AbstractVector}, ::Union{Nothing, Real}, ::Union{Nothing, Real}, ::Union{Nothing, Function, Type{<:DynamicExpressions.OperatorEnumModule.AbstractOperatorEnum}}, ::Union{Nothing, SymbolicRegression.CoreModule.MutationWeightsModule.AbstractMutationWeights, NamedTuple, AbstractVector}, ::Union{Nothing, Real}, ::Union{Nothing, Bool}, ::Union{Nothing, Real}, ::Union{Nothing, Integer}, ::Union{Nothing, Real}, ::Union{Nothing, Function, Real}, ::Union{Nothing, Bool}, ::Union{Nothing, Integer}, ::Bool, ::Symbol, ::Union{Nothing, Function, SymbolicRegression.CoreModule.OptionsStructModule.ComplexityMapping}, ::Bool, ::Bool, ::Union{Nothing, Bool}, ::Union{Nothing, Real}, ::Union{Nothing, Real}, ::Bool, ::Union{AbstractString, Optim.AbstractOptimizer}, ::Int64, ::AbstractFloat, ::Union{Nothing, Integer}, ::Union{Nothing, Integer}, ::Union{Nothing, Dict, NamedTuple, Optim.Options}, ::Bool, ::Bool, ::Bool, ::Union{Nothing, Real}, ::Union{Nothing, Real}, ::Union{Nothing, Integer}, ::Union{Nothing, Real}, ::Union{Nothing, Integer}, ::IO, ::Bool, ::Bool, ::Union{Nothing, ADTypes.AbstractADType, Symbol}, ::Bool, ::Any, ::Union{Nothing, Integer}, ::Integer, ::Union{Nothing, Bool}, ::Union{Nothing, String}, ::Bool, ::Any, ::Any, ::Union{Nothing, Integer}, ::Bool, ::AbstractString, ::Bool, ::Union{Nothing, Type{<:DynamicExpressions.ExpressionModule.AbstractExpression}}, ::Union{Nothing, NamedTuple}, ::Union{Nothing, Type{<:DynamicExpressions.NodeModule.AbstractExpressionNode}}, ::Union{Nothing, AbstractString}, ::Bool, ::Union{Nothing, Integer}, ::Union{Nothing, Integer}, ::Int64, ::Symbol, ::Union{Nothing, Int64}, ::Union{Nothing, Vector{Int64}}, ::Union{Nothing, Function}, ::Union{Nothing, Integer}, ::Union{Nothing, Vector{Symbol}}, ::Union{Nothing, SymbolicRegression.LoggingModule.AbstractSRLogger}, ::Bool, ::Union{Nothing, String}, ::Type{L}, ::Function, ::Type{D}) where {D<:DynamicQuantities.AbstractDimensions, L} got unsupported keyword arguments "binary_operators", "unary_operators", "maxsize", "niterations", "guesses", "batching", "batch_size" @ SymbolicRegression none:0 ``` ### Extra Info _No response_
关闭于 2026-02-01 3 条评论