Skip to content

Add R-style performance table with Great Tables and Reactable renderers - #288

Merged
uriahf merged 7 commits into
mainfrom
agent/performance-table-reactable
Aug 12, 2026
Merged

Add R-style performance table with Great Tables and Reactable renderers#288
uriahf merged 7 commits into
mainfrom
agent/performance-table-reactable

Conversation

@uriahf

@uriahf uriahf commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What changed

  • adds create_performance_table(), create_performance_table_times(), and render_performance_table() to the public Python API
  • keeps the existing Polars prepare_performance_data() / prepare_performance_data_times() pipelines as the numerical source of truth
  • adds Great Tables as the default renderer for Marimo and HTML output, styled to follow the original R Reactable table as closely as practical
  • preserves Reactable as renderer="reactable" for Quarto/Jupyter contexts, including sortable columns, in-cell data bars, model badges, grouped performance columns, and expandable confusion matrices
  • supports probability-threshold and PPCR stratification for the standard table
  • supports time-dependent tables across one or multiple fixed time horizons and one or multiple censoring/competing-event heuristic sets
  • keeps the time horizon, censoring heuristic, and competing-event heuristic visible in time-dependent output rather than collapsing distinct evaluation scenarios
  • normalizes integer observed times at the public _times table wrapper boundary, while relying on the shared time-dependent pipeline for integer/float fixed-horizon handling
  • adds a Marimo PR-preview demo using the Great Tables renderer, including a two-horizon time-dependent example
  • adds tests covering both renderers, prepared-data rendering, empty input, PPCR stratification, invalid renderer values, multiple time horizons, and multiple heuristic sets

API

# Marimo-friendly default
create_performance_table(probs, reals)

# Time-dependent performance table
create_performance_table_times(
    probs,
    reals,
    times,
    fixed_time_horizons=[365, 730],
)

# Reactable remains available for Quarto/Jupyter
create_performance_table(probs, reals, renderer="reactable")
create_performance_table_times(
    probs,
    reals,
    times,
    fixed_time_horizons=[365],
    renderer="reactable",
)

Renderer choice

Great Tables is the Marimo-safe default and is deliberately styled toward the original R performance table: model colors, grouped performance columns, compact layout, proportional metric bars, predicted-positive bars, and diverging net-benefit bars. Reactable remains an optional renderer for Quarto/Jupyter; this PR does not pursue Reactable support in Marimo.

Time-dependent design

create_performance_table_times() is intentionally a thin presentation wrapper around prepare_performance_data_times(). It does not introduce a second statistical implementation. The renderers display the time horizon and heuristic dimensions explicitly so results from different time-dependent evaluation scenarios remain distinguishable.

Validation

  • tests cover Great Tables and Reactable time-dependent output, multiple horizons, multiple heuristic sets, integer observed times through the public table wrapper, and integer/float fixed horizons through the shared pipeline
  • the PR preview includes a Great Tables time-dependent example with fixed horizons 5 and 10 for visual review

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-12 10:57 UTC

@uriahf
uriahf marked this pull request as ready for review August 11, 2026 13:11
@uriahf uriahf changed the title Add Reactable performance table Add R-style performance table with Great Tables and Reactable renderers Aug 11, 2026
@uriahf
uriahf force-pushed the agent/performance-table-reactable branch from b3c4e4a to fd5aad7 Compare August 12, 2026 07:11
@uriahf
uriahf merged commit 43524a0 into main Aug 12, 2026
3 checks 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.

1 participant