Benchmarking ML Covariate Screening With Synthetic PK Parameters

Purpose

This vignette demonstrates a synthetic benchmark workflow for pharmax.ml. It is exploratory decision support only. It does not establish clinical validity or regulatory validation.

library(pharmax.ml)
#> pharmax.ml 0.3.0.9000 | R-native public proof slice

Generate Synthetic Scenarios

known_signal <- px_simulate_covariates(n = 120, scenario = "known_signal", seed = 2026)
missingness <- px_simulate_covariates(n = 120, scenario = "missingness", seed = 2026)

head(known_signal)
#>     COV_WT  COV_AGE  COV_ALB   COV_SCR  COV_BMI     ETA_CL      ETA_V
#> 1 75.20589 77.87445 4.305298 1.1913715 29.56883  0.7490751  0.5630393
#> 2 59.20309 80.58157 4.244168 0.5323115 31.62620 -0.7731816 -0.2646415
#> 3 71.39238 57.77748 4.678305 0.5336162 26.30571  0.1801818  1.0679644
#> 4 69.15251 65.76335 4.493324 0.6517231 23.14172  0.1674935  0.5781191
#> 5 63.33360 34.13449 4.198195 1.1766099 34.41520 -0.5519423  0.3772962
#> 6 44.83911 60.62618 4.191514 1.1256459 33.73746 -1.8423279 -0.7352037
sum(is.na(missingness))
#> [1] 25

Run A Small Benchmark

benchmark <- px_benchmark_covariate(
  scenarios = c("known_signal", "no_signal", "correlated", "missingness"),
  replicates = 3,
  n = 100,
  method = "cor",
  seed = 2026
)

benchmark
#> pharmax covariate benchmark
#> 
#> # A tibble: 4 × 5
#>   scenario     replicates signal_top_rate median_signal_rank mean_top_importance
#>   <chr>             <int>           <dbl>              <int>               <dbl>
#> 1 correlated            3           1                      1               0.460
#> 2 known_signal          3           1                      1               0.714
#> 3 missingness           3           1                      1               0.730
#> 4 no_signal             3           0.333                  5               0.443
#> 
#> Interpretation: synthetic evidence for screening behavior, not clinical validation.
plot(benchmark)

Create A Decision-Support Report

quality <- px_data_quality(known_signal, impute = "median")
screen <- px_covariate(quality$data, method = "auto", n_top = 3, seed = 2026)
calibration <- px_calibrate_conformal(
  truth = known_signal$ETA_CL[1:40],
  lower = known_signal$ETA_CL[1:40] - 0.5,
  upper = known_signal$ETA_CL[1:40] + 0.5,
  prediction = known_signal$ETA_CL[1:40],
  alpha = 0.1
)

px_ml_report(
  screen,
  quality = quality,
  calibration = calibration,
  benchmark = benchmark,
  context = list(context_of_use = "Synthetic covariate-screening demonstration")
)
#> pharmax ML decision-support report
#> 
#> Top signals:
#> # A tibble: 2 × 6
#>   parameter covariate importance methods                  method_agreement  rank
#>   <chr>     <chr>          <dbl> <chr>                               <int> <int>
#> 1 ETA_CL    COV_WT         0.839 aalasso, cor, elastic_n…                5     1
#> 2 ETA_V     COV_ALB        0.954 aalasso, cor, elastic_n…                5     1
#> 
#> Limitations:
#> * Exploratory decision support only.
#> * Synthetic/public examples do not establish clinical validity.
#> * Human pharmacometric review is required before acting on results.
#> 
#> 
#> Human oversight: Outputs are intended for human-reviewed model-informed workflow support.