Re-using best equation strings #707
Unanswered
KevinG1002
asked this question in
Q&A
Replies: 1 comment
-
Glad to hear you are liking it! :) If you run using MLJ, SymbolicRegression
# ...
fit!(mach)
equations = report(mach).equations This is a vector of callable expression objects. You can call these with: eq = equations[end] # Most accurate expression is last one
# Note that the default selection is `report(mach).best_idx`
formatted_X = MLJ.matrix(X)' # Convert to matrix, and transpose to column-major
options = SymbolicRegression.MLJInterfaceModule.get_options(model) # Equivalent of `Options(...)`
eq(formatted_X, options) This will evaluate the resultant equation on Sorry that you need to call |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
New user here (SymbolicRegression.jl) and I absolutely love it!
I was wondering if anyone knew a way to turn the equation strings that are obtained after n-iterations into a callable function so that, for example:
returned_equ = (((x₅ * -50) * x₁) + -2)
could be easily turned into a callable likef = turn_to_callable(equation_str)
withf(x_1, x_2, ..., x_n) = ....
yielding the result of the computation in the equation string (a bit similar to whatPolynomials.jl
does). I am essentially looking for something that could be easily applied to any new vector[x_1, x_2, ..., x_n]
without going throughpredict(mach, x_test)
.Perhaps, to simplify things, how does
predict(mach, x_test)
work exactly?Beta Was this translation helpful? Give feedback.
All reactions