-
Notifications
You must be signed in to change notification settings - Fork 118
Add abstract types for single- and multi-target MLJ Regressors. #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add abstract types for single- and multi-target MLJ Regressors. #398
Conversation
…ressor objects. Right now, SRRegressor and MultitargetSRRegressor subtype AbstractSRRegresor. However, much of the `src/MLJInterface.jl` code dispatches on either SRRegressor or MultitargetSRRegressor. This creates a bottleneck for defining custom MLJInterfaces and forces redefinition of much of `src/MLJInterface.jl`. The commit addresses this by introducing two new types, SingletargetAbstractSRRegressor and MultitargetAbstractSRRegressor, and changes logic in `src/MLJInterface.jl` to dispatch on these types instead. Note: This approach is kind of janky as it solves the reuse problem using multiple inheritence (which might cause problems of its own if abused). This can be trimmed further / I'm open to rethinking this.
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
|
Sounds good to me. One minor thing is it should be |
…l into customize-mlj-interface
Pull Request Test Coverage Report for Build 13093567852Details
💛 - Coveralls |
3bf5b68 to
e6a502d
Compare
This allows us the SRFitResult struct for LaSR. It shouldn't cause any conflicts with upstream code.
|
@MilesCranmer might need your help debugging this. The test case for parametric expressions with the Zygote autodiff seem to be failing even on the SymbolicRegression master branch. |
|
Sorry for the delay. This turned out to be from an update to DifferentiationInterface.jl which has since been fixed:
Just waiting on a release now. |
MilesCranmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!!
Right now, SRRegressor and MultitargetSRRegressor subtype AbstractSRRegresor. However, much of the
src/MLJInterface.jlcode dispatches on either SRRegressor or MultitargetSRRegressor. This creates a bottleneck for defining custom MLJInterfaces and forces redefinition of much ofsrc/MLJInterface.jl. The commit addresses this by introducing two new types, SingletargetAbstractSRRegressor and MultitargetAbstractSRRegressor, and changes the logic insrc/MLJInterface.jlto dispatch on these types instead.Note: This approach is kind of janky as it solves the reuse problem using multiple inheritance (which might cause problems of its own if abused). This can be trimmed further / I'm open to rethinking this.