diff --git a/docs/operators.md b/docs/operators.md index 012f9ff9b..a469d21bb 100644 --- a/docs/operators.md +++ b/docs/operators.md @@ -14,6 +14,9 @@ A selection of these and other valid operators are stated below. - `*` - `/` - `^` +- `max` +- `min` +- `mod` - `cond` - Equal to `(x, y) -> x > 0 ? y : 0` - `greater` @@ -22,7 +25,6 @@ A selection of these and other valid operators are stated below. - Equal to `(x, y) -> (x > 0 || y > 0) ? 1 : 0` - `logical_and` - Equal to `(x, y) -> (x > 0 && y > 0) ? 1 : 0` -- `mod` **Unary** @@ -60,7 +62,7 @@ A selection of these and other valid operators are stated below. ## Custom Instead of passing a predefined operator as a string, -you can define with by passing it to the `pysr` function, with, e.g., +you can just define a custom function as Julia code. For example: ```python PySRRegressor( diff --git a/pysr/export_sympy.py b/pysr/export_sympy.py index b14db0ee0..f99a54a00 100644 --- a/pysr/export_sympy.py +++ b/pysr/export_sympy.py @@ -47,9 +47,9 @@ "ceil": sympy.ceiling, "sign": sympy.sign, "gamma": sympy.gamma, + "round": lambda x: sympy.ceiling(x - 0.5), "max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)), "min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)), - "round": lambda x: sympy.ceiling(x - 0.5), "cond": lambda x, y: sympy.Piecewise((y, x > 0), (0.0, True)), "logical_or": lambda x, y: sympy.Piecewise((1.0, (x > 0) | (y > 0)), (0.0, True)), "logical_and": lambda x, y: sympy.Piecewise((1.0, (x > 0) & (y > 0)), (0.0, True)), diff --git a/pysr/version.py b/pysr/version.py index 8a8995f2f..b127c680f 100644 --- a/pysr/version.py +++ b/pysr/version.py @@ -1,2 +1,2 @@ -__version__ = "0.16.4" +__version__ = "0.16.5" __symbolic_regression_jl_version__ = "0.22.5"