Repository navigation
Updating to 2.0 with MLJ? #1383
|
Hi! |
Replies: 1 comment 2 replies
|
What is the error you are seeing? I am not sure I 100% follow. But you can use the normal Julia package install command to get SymbolicRegression, i.e., And yes in SymbolicRegression you can import the necessary components directly from SR, no need for a separate MLJ install import SymbolicRegression: SRRegressor, machine, fit!, predict, report
# Dataset with two named features:
X = (a = rand(500), b = rand(500))
# and one target:
y = @. 2 * cos(X.a * 23.5) - X.b ^ 2
# with some noise:
y = y .+ randn(500) .* 1e-3
model = SRRegressor(
niterations=50,
binary_operators=[+, -, *],
unary_operators=[cos],
)
mach = machine(model, X, y)
fit!(mach)
report(mach) |


I don't see an error. So what I think was happening is I had SymbolicRegression loaded in my default environment that I no longer use. I guess "import SymbolicRegression" took it from the default environment.
Here is my environment I actively develop in. As you can see, no SR:
But here is my Default env:
I will just remove the package from my default environment and re-install on my actively developed environment. That should clear up the issue.