Closed lysukhin closed 8 months ago
Thanks again for the suggestion - we can continue high-level discussion in #311. I've created the branch 316-mil-slide-aggregate, and I'll update this issue when a first-pass implementation is ready.
This feature has been implemented on the dev
branch. You can now aggregate bags of features at the patient level, rather than the slide level, by setting the MIL parameter aggregation_level
to "patient"
(defaults to "slide"
):
from slideflow.mil import mil_config
config = mil_config(..., aggregation_level='patient')
You can then train as usual. The saved predictions, slide manifest, and reported metrics will all reflect patient-level predictions rather than slide-level predictions.
Thanks again for the suggestion! And thanks to @matte-esse for the implementation. Let us know if you encounter any issues with this new feature or have other suggestions.
Actually going to reopen this for now until we can do more testing - looks like evaluation might not be working correctly.
Wonderful news, will certainly check this out in a few days. Thanks for the responsiveness and pace!
Ok - latest update on dev
(c601f85) should have this patched. Training and evaluating an MIL model with aggregation_level="patient"
should work as intended. Let me know if you encounter any issues! Otherwise, we'll fold this into the next 2.2
release.
Going to try this on custom data in a day or two, can post feedback here as an early access tester :)
This has now been released in version 2.2.0, going to close the issue out for now.
Thanks again for the suggestion! Let me know if there are any issues.
Discussed in https://github.com/jamesdolezal/slideflow/discussions/311