Skip to content

Add time-dependent concordance metrics#24

Merged
shi-ang merged 16 commits into
mainfrom
shiang/time-dependent-concordance
Jun 18, 2026
Merged

Add time-dependent concordance metrics#24
shi-ang merged 16 commits into
mainfrom
shiang/time-dependent-concordance

Conversation

@shi-ang

@shi-ang shi-ang commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Description

Adds time-dependent concordance support for survival-curve and hazard-rate predictions, updates the evaluator/API surface, and prepares the documentation and version metadata for the next release.

Updates

  1. Add concordance_time_dependent and SurvivalEvaluator.concordance_time_dependent for Antolini-style survival-curve scoring and IPCW-based time-dependent concordance.
  2. Add hazard-rate prediction support for the Gandy-Matcham crossing-hazards concordance use case.
  3. Factor shared concordance utilities and add target-time validation coverage.
  4. Reconstruct the README metric reference sections with paper-linked metric tables, including Antolini's time-dependent C-index and Gandy-Matcham's time-dependent C-index.
  5. Bump the package version and changelog for the 0.8.0 release.

Fixes

N/A

Mandatory Checklist

  • All new or modified features have corresponding test cases.

  • I have run all the tests, using pytest, and this is the log I get:

conda run -n SurvEVAL pytest
183 passed, 18 warnings in 5.45s
  • All new functions, classes, and modules contain clear docstrings and inline comments.

  • All jupyter notebooks are runnable with expected results.

    Not run; no notebook changes.

  • I have reformatted and ran isort . and black . (in this same order) on the codebase.

  • I have updated the README and added or edited any new scripts to the integration tests.

  • I have ensured sufficient coverage on the newly implemented features.

  • I have made sure that both the requirements.txt and pyproject.toml files are updated according to the newly introduced dependencies.

    No new dependencies introduced.

  • Paste the remaining code TODOs using the command grep -rI --color=auto --exclude-dir={.git,__pycache__,env_folder,.venv,venv,.cache,output,.github,} 'TODO' . here, and explain them if necessary:

setup.py:59:TODO:
SurvivalEVAL/Evaluations/MeanError.py:164:        # Error is too small for numerical integration. TODO: consider change the code.
SurvivalEVAL/Evaluations/MeanError.py:466:    # TODO: We need to move this function to util.py since other evaluation metrics might use it.

Existing TODOs are unrelated to this PR.

@shi-ang
shi-ang requested a review from Copilot June 17, 2026 08:20
@shi-ang

shi-ang commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds time-dependent concordance scoring to SurvivalEVAL (including Antolini-style survival-curve scoring and IPCW-weighted variants), extends the evaluator API to support hazard-rate–based risk scoring, and updates docs/versioning for the 0.8.0 release.

Changes:

  • Introduces concordance_time_dependent plus shared concordance utilities (_concordance_utils) and corresponding evaluator method SurvivalEvaluator.concordance_time_dependent.
  • Adds consistent target-time validation (validate_time_points) and a new hazard-rate extraction path (predict_multi_hazards_from_curve) for crossing-hazards concordance use cases.
  • Expands test coverage and refreshes README metric tables + bumps version/changelog to 0.8.0.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_util.py Adds unit tests for validate_time_points validation behavior.
tests/test_time_dependent_concordance.py New end-to-end and brute-force parity tests for time-dependent concordance counting and IPCW behavior.
tests/test_evaluator.py Adds evaluator-level validation tests and hazard extraction tests.
tests/test_concordance.py Updates tests to use refactored concordance count utilities.
SurvivalEVAL/version.py Bumps package version to 0.8.0.
SurvivalEVAL/NonparametricEstimator/SingleEvent/Fiducial.py Modernizes typing annotations (Tupletuple).
SurvivalEVAL/Evaluator.py Adds time-dependent concordance API + hazard prediction helper + stricter curve/grid validation.
SurvivalEVAL/Evaluations/util.py Adds validate_time_points and routes existing probability helpers through it.
SurvivalEVAL/Evaluations/TimeDependentConcordance.py Implements time-dependent concordance (Antolini/Naive/IPCW) and pair counting.
SurvivalEVAL/Evaluations/OtherMetrics.py Modernizes typing annotations (Tupletuple).
SurvivalEVAL/Evaluations/Concordance.py Factors shared concordance machinery into _concordance_utils and updates error types.
SurvivalEVAL/Evaluations/_concordance_utils.py New shared utilities for concordance pair counting/finalization.
SurvivalEVAL/init.py Exposes new concordance_time_dependent at package top-level and adjusts exports.
README.md Rebuilds metric reference sections with tables and adds time-dependent concordance documentation.
CHANGELOG.md Adds 0.8.0 release notes describing the new time-dependent concordance functionality.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SurvivalEVAL/Evaluations/util.py
Comment thread SurvivalEVAL/Evaluator.py Outdated
Comment thread SurvivalEVAL/Evaluator.py Outdated
Comment thread SurvivalEVAL/__init__.py
Comment thread SurvivalEVAL/__init__.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38d5094511

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SurvivalEVAL/Evaluator.py Outdated
@shi-ang
shi-ang marked this pull request as ready for review June 17, 2026 15:54
@shi-ang
shi-ang requested a review from Copilot June 17, 2026 15:54
@shi-ang

shi-ang commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Comment thread SurvivalEVAL/Evaluator.py Outdated
Comment thread SurvivalEVAL/Evaluator.py Outdated
Comment thread README.md Outdated
Comment thread SurvivalEVAL/Evaluations/OtherMetrics.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 825632d7da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SurvivalEVAL/__init__.py
shi-ang and others added 2 commits June 18, 2026 00:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@shi-ang
shi-ang requested a review from Copilot June 18, 2026 06:35
@shi-ang

shi-ang commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5f35078b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SurvivalEVAL/Evaluator.py Outdated
Comment thread SurvivalEVAL/__init__.py
@shi-ang
shi-ang requested a review from Copilot June 18, 2026 08:18
@shi-ang

shi-ang commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 6a230bec8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shi-ang
shi-ang merged commit f8fae3a into main Jun 18, 2026
1 check passed
@shi-ang
shi-ang deleted the shiang/time-dependent-concordance branch June 18, 2026 08:25
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.

2 participants