Defining a custom operator without needing the sympy mapping #233
MilesCranmer
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
model = PySRRegressor( model.fit(X, y)
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This was in an email discussion with a user:
The solution is to define a
sympy.Function
with the name of your custom operator - then sympy won't map it into other sympy functions.For example, say we want to define a custom logarithm function:
Then, this can be used normally, and the sympy export will just use
my_log
, rather than needing to convert it to native sympy functions.This could also be used if you want to define custom LaTeX for some operator.
Beta Was this translation helpful? Give feedback.
All reactions