Commit b88f38c
<!--
🙌 Thanks for contributing a pull request!
If this is your first contribution, take a look at our contribution
guidelines:
https://docs.skore.probabl.ai/dev/contributing.html
-->
#### Change description
<!--
Please describe what your contribution changes for skore.
Here is some inspiration for what to write here:
- Are you adding a new feature? Fixing a bug?
- Can you give an example of your change in action, e.g. a snippet of
code or a plot?
- Is your change likely to break users' code?
- Are there any other details the reviewer should be aware of, such as
API design choices, performance characteristics or edge cases?
Please reference issues/PRs when possible, e.g. "Fixes probabl-ai#1234", "Closes
#3456", "See also #7890".
More information
[here](https://github.com/blog/1506-closing-issues-via-pull-requests).
-->
`EstimatorReport.metrics.summarize()` no longer accepts arguments
`flat_index` or `favorability`. These have been moved to
`MetricsSummaryDisplay.frame()`.
This moves the responsibility of displaying things from
`EstimatorReport._MetricsAccessor` to `MetricsSummaryDisplay`.
```python
# Before
report.metrics.summarize(flat_index=True, favorability=True).frame()
# After
report.metrics.summarize().frame(flat_index=True, favorability=True)
```
This is a breaking change.
The rest of the PR consists in various refactorings, in particular the
tests have been updated to reflect the change in responsibility:
- Tests of `summarize()` were extracted from
`tests/unit/reports/estimator/metrics/test_numeric.py` to a new file,
`tests/unit/reports/estimator/metrics/test_summarize.py`.
- `test_summarize.py` now tests that `summarize()` behaves well, and
that the output of `summarize()` has a well-formed DataFrame. `.frame()`
is never called.
- `displays/metrics_summary/test_estimator.py` has been rewritten to
specifically test `.frame()` arguments.
A number of commits are included that could be pulled out into a
separate PR if needed.
Closes probabl-ai#2533
Supersedes probabl-ai#1839 in part
#### Contribution checklist
<!--
Below are some of the criteria that the review will include.
Feel free to use it as a checklist to ensure that your contribution is
high-quality.
-->
- [x] Unit tests were added or updated (if necessary)
- [x] Documentation was added or updated (if necessary)
#### AI usage disclosure
<!--
If AI tools were involved in creating this PR, please check all boxes
that apply
below and make sure you understand our [automated contributions
policy](https://docs.skore.probabl.ai/dev/contributing.html#automated-contributions-policy)
-->
AI tools were involved for:
- [ ] Code generation (e.g., when writing an implementation or fixing a
bug)
- [x] Test/benchmark generation
- [ ] Documentation (including examples)
- [ ] Research and understanding
In particular I used Claude to increase coverage.
<!-- Any other comments can go here. Thanks again for contributing! -->
1 parent c097861 commit b88f38c
File tree
14 files changed
+1217
-948
lines changed- examples/use_cases
- skore
- src/skore
- _sklearn
- _comparison
- _cross_validation
- _estimator
- _plot/metrics
- _utils
- tests/unit
- displays/metrics_summary
- reports
- comparison
- cross_validation/metrics
- estimator/metrics
- estimator
- metrics
- utils
14 files changed
+1217
-948
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 204 | + | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
209 | 226 | | |
210 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
211 | 230 | | |
212 | 231 | | |
213 | 232 | | |
| |||
224 | 243 | | |
225 | 244 | | |
226 | 245 | | |
227 | | - | |
| 246 | + | |
228 | 247 | | |
229 | 248 | | |
230 | 249 | | |
231 | 250 | | |
232 | 251 | | |
233 | 252 | | |
234 | | - | |
| 253 | + | |
235 | 254 | | |
236 | 255 | | |
237 | 256 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
199 | 204 | | |
200 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
201 | 208 | | |
202 | 209 | | |
203 | 210 | | |
| |||
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
223 | | - | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
0 commit comments