Skip to content
Discussion options

You must be logged in to vote

I think part of the issue is that the loss function is entirely dominated by a couple of points:

[ins] In [3]: X
Out[3]:
array([[1],
       [2],
       [3],
       [4],
       [5],
       [6],
       [7],
       [8]])

[ins] In [4]: y
Out[4]:
array([-2.00000000e+00,  1.60000000e+01, -3.84000000e+02,  1.53600000e+04,
       -8.60160000e+05,  6.19315200e+07, -5.44997376e+09,  5.66797271e+11])

It is trying to fit this with mean-square error so it will primarily just focus on the last two.

If I change the loss function to be relative error:

model = PySRRegressor(
    # ...
    elementwise_loss="(pred, targ) -> abs(pred - targ)/(abs(pred)+1)",
)

then it seems to work

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@matthiaswilhelmNBI
Comment options

Answer selected by MilesCranmer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants