-
Notifications
You must be signed in to change notification settings - Fork 8
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 report
method for merging fit reports with operational reports
#160
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #160 +/- ##
==========================================
- Coverage 88.75% 88.70% -0.06%
==========================================
Files 8 8
Lines 329 354 +25
==========================================
+ Hits 292 314 +22
- Misses 37 40 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Tweak warning for deprecated use of docstring/descr
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.
LGTM. Except for some questions I asked that needs to be addressed.
oops
Co-authored-by: Okon Samuel <39421418+OkonSamuel@users.noreply.github.com>
In support of JuliaAI/MLJBase.jl#831.
A non-breaking enhancement.
In this PR we:
report(::Model, report_given_method)
for combining the reports generated by a model'sfit
method, with reports generated by operations, such aspredict
. Herereport_given_method
is a dictionary of reports, keyed on methods as symbols (:fit
,:predict
,:transform
, and so forth).The docstring for the new method is copied below.
Merge the reports in the dictionary
report_given_method
into a singleproperty-accessible object. It is supposed that the keys of the dictionary are
:fit
and the symbolic names of MLJModelInterface.jl operations, such as:predict
or:transform
. Each value will be thereport
component returned by a training method(
fit
orupdate
) dispatched on themodel
type, in the case of:fit
, or thereport component returned by an operation that supports reporting.
New model implementations
Overloading this method is optional, unless the model generates reports that are neither
named tuples nor
nothing
.Assuming each dictionary value is a named tuple or
nothing
, the fallback returns theusual named tuple merge of the dictionary values, ignoring any
nothing
values, andassuming there are no conflicts between the keys of the dictionary values (the individual
reports). If there is a key conflict, all operation reports are first wrapped in a named
tuple of length one, as in
(predict=predict_report,)
.If any dictionary
value
is neither a named tuple nornothing
, it is first wrapped as(report=value, )
before merging.