# Symbolic regression fails this exponential pattern

**URL:** <https://discourse.julialang.org/t/symbolic-regression-fails-this-exponential-pattern/107095>\
**Category:** General Usage\
**Created:** [December 4, 2023, 6:25am UTC](https://discourse.julialang.org/t/symbolic-regression-fails-this-exponential-pattern/107095 "2023-12-04T06:25:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [December 4, 2023, 6:25am UTC](https://discourse.julialang.org/t/symbolic-regression-fails-this-exponential-pattern/107095/1 "2023-12-04T06:25:28Z")

</div>

MWE:

```julia
import SymbolicRegression: SRRegressor
import MLJ: machine, fit!, predict, report

X = (a=[(10.0-x)^x for x in 1:5],)

Y = [1.0,2.0,3.0,4.0,5.0]

model = SRRegressor(
    niterations=50,
    binary_operators=[+, -, *,^]
)

mach = machine(model, X, Y)

fit!(mach)

report(mach)

```

Symbolic regression fails to find this pattern. If you’re a maintainer of the package, you know better than me if it warrants investigation. This is a simple report from me. Thank you.

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [December 4, 2023, 7:41am UTC](https://discourse.julialang.org/t/symbolic-regression-fails-this-exponential-pattern/107095/2 "2023-12-04T07:41:18Z")

</div>

Are the `X`, `Y` switched here? I think you might have wanted to write

```julia
X = (a=[1.0,2.0,3.0,4.0,5.0],)

Y = [(10.0-x)^x for x in 1:5]

```

---

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [December 4, 2023, 7:48am UTC](https://discourse.julialang.org/t/symbolic-regression-fails-this-exponential-pattern/107095/3 "2023-12-04T07:48:58Z")

</div>

Oops… my point still holds though. It still fails after swapping the variables.
