Why do the data types of X and y need to match?
#996
Replies: 1 comment 5 replies
-
|
If you use the Julia backend directly, there is no such limitation. The Python side is a bit more rigid about this, which is partly for ease of use (so that most stuff “just works”) but also because of limitations in Scikit-Learn. For example, Scikit-Learn’s interface doesn’t even allow complex inputs to begin with (!), so PySR has to monkey patch it to force it to allow complex numbers. But MLJ.jl which is the Julia equivalent to Scikit-Learn, which SymbolicRegression.jl’s backend hooks into, allows arbitrary input and output types. (Even strings are allowed! https://ai.damtp.cam.ac.uk/symbolicregression/stable/examples/custom_types/) I guess in principle we could try to set up this on the Python side but it might be a pain and I feel the return on investment is low. Not sure |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Example:
Here,$x$ , $a$ , and $b$ are real, but $y$ is complex. To make this work in
SymbolicRegression.jl, we can add a fictitious0imtoX(X = X .+ 0im). This works for simple cases but slows down complex ones, since the search now explores the complex domain, even though all constants are real.Any way to avoid this and keep constants real? I know there's a workaround via writing custom loss functions, but I'm asking more generally why are we enforcing the type match in the first place?
Beta Was this translation helpful? Give feedback.
All reactions