[BUG]: num_features
for TemplateExpressionSpec doesn't work as written in API Ref
#811
Labels
bug
Something isn't working
What happened?
Heyo PySR team! The
num_features
parameter inTemplateExpressionSpec
is described in the API Reference as taking a Python dictionary as input, but doesn't behave that way, yielding aTypeError
as shown below:The Code & The Error
Code yielding TypeError:
ERROR:
JuliaError: TypeError: in typeassert, expected Symbol, got a value of type String
The Fix
This error is fixed if you rewrite the dictionary in Julia rather than Python, but I haven't managed to get it to pass a Python dict as described in the documentation. Here's the template with the single line change that allows the model to run:
The
ExpressionSpec
feature is a great addition, but it has some drawbacks which are bypassed by using a custom objective instead, though not without writing a bit of Julia.The expression output when using the templates is a tad confusing at first (outputting the numbers corresponding to variables in an expression, and restarting the numbering in the other expression) and it would be good to note that in the relevant section of the documentation.
Version
1.3.1
Operating System
Linux
Package Manager
pip
Interface
Jupyter Notebook
Relevant log output
Extra Info
No response
The text was updated successfully, but these errors were encountered: