How probabl-ai/skore works
Main Components
• Library Core: The heart of the project is within the “skore/src/skore” directory. This core has multiple submodules:
– Configuration and Exception Handling (e.g., _config, exceptions)
– Externals: Adapters for integrating with Pandas, scikit-learn, etc.
– Persistence: Including “persistence/item”, “persistence/repository”, and “persistence/storage” modules. These manage saving various data objects (charts, models, arrays, etc.) and offer different storage mechanisms (disk caching, in-memory storage).
– Sklearn Integrations: Modules under “skore/sklearn” (such as _base, _comparison, _cross_validation, _estimator, _plot, and train_test_split) that extend scikit-learn’s functionalities by offering diagnostic warnings, enhanced metrics, and plotting utilities.
– Project Management: The “skore/project” module that provides a simple API to store and retrieve artifacts (e.g., project.put and project.get).
– Utilities: Common helper functions spread throughout “skore/utils”.
• Testing & Examples: There is an extensive test suite (“skore/tests/unit” and “skore/tests/functional”) which emphasizes test-driven development, and the examples directory demonstrates how to use the library for various ML and reporting scenarios.
• CI/CD & DevOps: Presence of GitHub Actions workflows, pre-commit configurations, and CI scripts (in “skore/ci”) indicate a robust automated pipeline for linting, testing, and documentation (using Sphinx).
• Documentation: The “docs” and “sphinx” directories handle documentation building and deployment. Sphinx-specific configurations and templates exist to render user documentation and API references.
Out the Relationships and Interactions
• The core library functions as the central processing engine. It interacts with external libraries like scikit-learn (for model inputs, training, and validations) and Pandas/NumPy for data handling.
• The Persistence Layer interacts with the core evaluation components by storing and retrieving various report objects and data artifacts.
• The sklearn extension modules produce reports and warnings that are orchestrated by the EstimatorReport and CrossValidationReport features.
• The Project Management component sits on top of the persistence capability to allow users to easily save and later access their results.
• CI/CD pipelines and tests ensure the robustness and maintainability of all these components.
• The documentation layer (built with Sphinx) ties together usage examples, API reference details, and guides for new users.
Architectural Patterns and Design Principles
• The modular separation of concerns is clear: each major functionality (evaluation, persistence, sklearn integration, project management, utilities) is isolated into submodules.
• The design leverages the dependency inversion principle – the high-level components (like project and estimator reporting) rely on lower-level services (like persistence or external library integrations) that can potentially be swapped or extended.
• Extensive use of unit and functional tests attests to a design that emphasizes maintainability and reliability.
• CI/CD and documentation automation are integral parts of the development process.
Relevant Technologies and Tools
• Programming Language: Python (supporting versions 3.9 through 3.12).
• Core External Libraries: Scikit-learn, Pandas, NumPy, matplotlib, plotly, altair, etc.
• Documentation: Sphinx.
• Testing: Pytest (implied by the tests structure), along with CI pipelines via GitHub Actions.
• DevOps: GitHub Actions and Dependabot for dependency management.
Detail and Clarity
• Component (even those with submodules) are clearly represented to capture the intricacies of the design.
• Don’t shy away from splitting the architecture into multiple layers if needed – the goal is to capture as many essential architectural elements as possible for the principal software engineer’s review.