Skip to content
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

Forward (::Machine).fitresult to RecipesBase #951

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

MilesCranmer
Copy link
Contributor

@MilesCranmer MilesCranmer commented Jan 8, 2024

@ablaom

Apparently this is the idiomatic way to set up plotting recipes on custom types: https://docs.juliaplots.org/latest/RecipesBase/api/#RecipesBase.@recipe-Tuple{Expr}

With this change, a downstream package will be able to define:

@recipe function plot_my_regressor(fitresult::MyFitresultType)
    ...
end

and enable custom plotting of their fitted model.


Confirmed that this works for SymbolicRegression's regressors!


Fixes JuliaAI/MLJModelInterface.jl#188

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (081fec8) 88.05% compared to head (ad03525) 87.95%.

Files Patch % Lines
src/plots.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #951      +/-   ##
==========================================
- Coverage   88.05%   87.95%   -0.10%     
==========================================
  Files          27       28       +1     
  Lines        2519     2540      +21     
==========================================
+ Hits         2218     2234      +16     
- Misses        301      306       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ablaom ablaom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for this contribution, @MilesCranmer.

@ablaom ablaom merged commit 6e3e285 into JuliaAI:dev Jan 9, 2024
4 of 5 checks passed
@MilesCranmer MilesCranmer deleted the plotting branch January 9, 2024 19:55
This was referenced Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Machine abstract type?
2 participants