Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ regression problem.

3. **Is it possible to get the best individuals in a sympy format?**

Yes, but only for standard algebraic symbolic regression, by using the class method `get_best_individual_sympy`.
Yes, but only for standard algebraic symbolic regression, by using the class method `get_best_individual_sympy`. You need to define an appropriate `conversion_rules` dictionary, that converts `flex` primitives to the `sympy` format. Then you should set in the regressor definition `sympy_conversion_rules=conversion_rules`.
We suggest to have a look on the `simple_sr` tutorial for more details.

4. **Why isn't there a pre-defined fitness/predict/score function?**

Expand Down
150 changes: 94 additions & 56 deletions docs/tutorials/simple_sr.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/flex/gp/numpy_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
"aq": lambda *args_: "Mul({}, Pow(Add(1, Pow({}, 2)), -1/2))".format(*args_),
"prot_pow": lambda *args_: "Pow(Abs({}), {})".format(*args_),
"prot_log": lambda *args_: "log(Abs({}))".format(*args_),
"log": lambda *args_: "log({}))".format(*args_),
}
5 changes: 3 additions & 2 deletions src/flex/gp/regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ class GPSymbolicRegressor(RegressorMixin, BaseEstimator):
batch_size : batch size used for Ray-based fitness evaluation.
num_cpus: number of CPUs allocated to each Ray task.
max_calls: maximum number of tasks a Ray worker can execute before restart.
The default is 0, which means infinite number of tasks.
The default is `0`, which means infinite number of tasks.
custom_logger: user-defined logging function called with the best individuals.
special_term_name: name used for ephemeral constants during SymPy conversion.
sympy_conversion_rules: mapping from GP primitives to SymPy primitives.
sympy_conversion_rules: mapping from GP primitives (DEAP) to SymPy primitives.
The default is `None`, which means that sympy conversion is disabled.
multiprocessing: whether to use Ray for parallel fitness evaluation.
"""

Expand Down