Skip to content

Live demo

This widget runs a simplified classical model entirely in your browser. There is no server: the logistic regression's coefficients and the scaler statistics are exported to JSON, and the sigmoid is recomputed in JavaScript as you move the sliders.

Read this first

This is a deliberately simplified demonstration model fit on six interpretable inputs. It is not the full benchmark model and is not for clinical use. Its own held-out ROC-AUC is shown below so you can judge it honestly. The quantum models are not used here: they sit at chance on this task (see Findings) and are far too slow to run live.

Loading the demo model...

How it works

When you change an input, the browser computes, for each feature,

z_i   = (input_i - scaler_mean_i) / scaler_scale_i
logit = intercept + sum_i ( coef_i * z_i )
p     = 1 / (1 + exp(-logit))

which is exactly what scikit-learn's LogisticRegression does on StandardScaler-transformed inputs. tests/test_demo_export.py asserts this JavaScript formula reproduces the Python model's predict_proba to within 1e-9, so what you see in the browser matches the trained model.

The model is produced by scripts/export_demo_model.py, which fits the compact logistic regression on a held-out split, records its ROC-AUC, and writes everything to docs/assets/data/demo_model.json. Because one of the six inputs is the APACHE-IVa baseline risk score (already a strong clinical predictor), this small model scores close to the full benchmark model, which is expected rather than a quantum effect.