Skip to content

Conversation

@uriahf
Copy link
Owner

@uriahf uriahf commented Dec 24, 2025

No description provided.

uriahf and others added 22 commits December 22, 2025 07:43
Adds a new `smooth` option to the `calibration_type` parameter in the `create_calibration_curve` function. This option generates a smoothed calibration curve using a LOESS smoother, replicating the functionality of the R `rtichoke` package.

The implementation includes:
- Adding `statsmodels` as a new dependency for the LOESS implementation.
- A new helper function `_calculate_smooth_curve` to perform the smoothing and interpolation.
- Updates to the plotting logic to render the smoothed curve.
- New tests to verify the functionality of the smoothed curve, including an edge case for a single unique probability value.
- A fix for a `DuplicateError` in the existing decile calculation when handling uniform probability distributions.
…302425152341313956

feat: Add smoothed calibration curve
This commit introduces a new function, `create_calibration_curve_times`, for generating time-dependent calibration curves.

This function provides an interactive calibration curve plot with a slider to adjust the time horizon. It also handles administrative censoring and various data filtering heuristics for competing risks.

Key changes:
- Added `create_calibration_curve_times` function to `rtichoke/calibration/calibration.py`.
- Implemented helper functions for data preparation (`_create_calibration_curve_list_times`) and plotting (`_create_plotly_curve_from_calibration_curve_list_times`).
- Added a new helper function `_apply_heuristics_and_censoring` to handle censoring and competing risk logic.
- Added unit tests for the new heuristic logic in `tests/test_heuristics.py`.
- Added a smoke test for the new `create_calibration_curve_times` function in `tests/test_calibration_times.py`.
- Refactored hover text logic into a shared helper function to reduce code duplication.
…703731330045434

feat: Add create_calibration_curve_times function
This commit improves the data loading logic for calibration curves to be more robust and flexible.

The previous implementation was too strict about the types of input it accepted and was not robust enough in handling different data shapes. This commit corrects the data loading logic to handle different input types (lists and NumPy arrays) and data shapes for both single and multiple population scenarios.
This commit improves the data loading logic for calibration curves to be more robust and flexible.

The previous implementation was too strict about the types of input it accepted and was not robust enough in handling different data shapes. This commit corrects the data loading logic to handle different input types (lists and NumPy arrays) and data shapes for both single and multiple population scenarios.
…703731330045434

Feat/calibration curve times 1091703731330045434
This commit resolves all type errors reported by the `ty` type checker, ensuring that the project's type hints are correct and consistent. Additionally, it updates the `AGENTS.md` file to include instructions on how to run `ty` for future development.
This commit refactors the `helpers` module into a `processing` module with a more logical structure. The `sandbox_observable_helpers.py` file has been split into three new modules: `adjustments.py`, `combinations.py`, and `transforms.py`.

This change improves the maintainability and readability of the codebase.
@uriahf uriahf merged commit b9a0648 into main Dec 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add updated functions create_calibration_curve() and create_calibration_curve_times()

2 participants