diff --git a/pysr/sr.py b/pysr/sr.py index db38a5a67..e4e92b755 100644 --- a/pysr/sr.py +++ b/pysr/sr.py @@ -345,7 +345,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator): function eval_loss(tree, dataset::Dataset{T,L}, options)::L where {T,L} prediction, flag = eval_tree_array(tree, dataset.X, options) if !flag - return T(Inf) + return L(Inf) end return sum((prediction .- dataset.y) .^ 2) / dataset.n end