probabl-ai / skore

Skore lets you "Own Your Data Science." It provides a user-friendly interface to track and visualize your modeling results, and perform evaluation of your machine learning models with scikit-learn.
https://probabl-ai.github.io/skore/
MIT License
70 stars 7 forks source link

refactor: Centralize cross-validation logic #751

Open thomass-dev opened 1 day ago

thomass-dev commented 1 day ago

The code is spread between items/cross_validation_item.py and sklearn/cross_validation.py. I find it pretty hard to contribute and to maintain.

I recommend to centralize the logic in a sklearn/cross_validate/ directory, leaving items/cross_validation_item.py just as a class containing data (without business logic). I recommend to split the code from sklearn/cross_validation.py in dedicated files (plot, compute etc.).

In addition, i recommend slightly modifying the code of the cross_validation function itself to create item only when necessary. My idea is to create the plot first, show the plot after, and in the late part create the item if necessary.