MilesCranmer commited on
Commit
aa8371c
1 Parent(s): e3e75fd

Improve docs on `full_objective`

Browse files
Files changed (1) hide show
  1. pysr/sr.py +4 -1
pysr/sr.py CHANGED
@@ -341,7 +341,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
341
  of loss function or regularizations. The default `full_objective`
342
  used in SymbolicRegression.jl is roughly equal to:
343
  ```julia
344
- function eval_loss(tree, dataset::Dataset{T}, options) where T
345
  prediction, flag = eval_tree_array(tree, dataset.X, options)
346
  if !flag
347
  return T(Inf)
@@ -350,6 +350,9 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
350
  end
351
  ```
352
  where the example elementwise loss is mean-squared error.
 
 
 
353
  Default is `None`.
354
  complexity_of_operators : dict[str, float]
355
  If you would like to use a complexity other than 1 for an
 
341
  of loss function or regularizations. The default `full_objective`
342
  used in SymbolicRegression.jl is roughly equal to:
343
  ```julia
344
+ function eval_loss(tree, dataset::Dataset{T}, options)::T where T
345
  prediction, flag = eval_tree_array(tree, dataset.X, options)
346
  if !flag
347
  return T(Inf)
 
350
  end
351
  ```
352
  where the example elementwise loss is mean-squared error.
353
+ You may pass a function with the same arguments as this (note
354
+ that the name of the function doesn't matter). Here,
355
+ both `prediction` and `dataset.y` are 1D arrays of length `dataset.n`.
356
  Default is `None`.
357
  complexity_of_operators : dict[str, float]
358
  If you would like to use a complexity other than 1 for an