Custom objective questions #373
Replies: 2 comments 1 reply
-
You can get the number of rows from |
Beta Was this translation helpful? Give feedback.
1 reply
-
With so much Julia customization, it might be easier to work on this directly from Julia? i.e., with SymbolicRegression.jl? |
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
-
EDIT: Resolved. I figured out the reason for the difference.
In my Julia helper's code, length(prediction) was 100 (correct, because I am trying to divide by the number of points, was 100).
While in my model's objective function, length(prediction) was 1.
So, in the model's objective function, I just changed length(prediction) to sizeof(prediction)[1].
Hi,
When I run the following objective function:
and then I define the PySR model as:
I define the dataset in Python as:
Then I run
(I do all this in a Python shell inside the MacBook terminal),
the final value of models has a equations_ of 9 equations (so 9 rows).
The model.equations_[8, :] (so the last equation found by the model "model") is:
complexity 17
loss 0.00174
score 1.872243
equation '(((1.4335294 / (x0 + 1.6759317)) + 0.6227007) / (0.21702437 - ((-1.312221 - (-0.2316349 / x0)) - x0)))
sympy_format (0.6227007 + 1.4335294/(x0 + 1.6759317))/(x0 +...
lambda_format PySRFunction(X=>(0.6227007 + 1.4335294/(x0 + 1...
Name: 8, dtype: object
However, when I run this exact equation using a Julia helper object ("jl"), I get a infinity value for the loss.
Specifically, I use the "jl" julia helper and I run:
The output of running this jl.eval() was:
And it's not just this one time that I ran model.fit(X, y) that I noticed a difference between the model's reported loss of the model's last-found function and the usually-more correct outputted value of passing the model's last-found function into a Julia objective function manually and manually running the jl.eval() of that Julia code.
Another question: What would "WARNING: Method definition (::Main.var"#f#52"{tree, options})(Any) in module Main at none:26 overwritten at none:69." mean, what are its negative consequences, and how do I change my code to avoid this warning message?
Beta Was this translation helpful? Give feedback.
All reactions