Overview
This knowledge base consolidates core concepts, mathematical formulas, and practical insights from the platform's two proof-of-concept modules:
- Heart Disease module - binary classification using supervised learning
- Influenza module - time series analysis and forecasting
Purpose
A quick reference for the statistical and machine-learning methods used across the platform. Each topic covers a clear definition, the underlying formula, and the practical context from the PoCs.
Use the panel on the right to jump between topics - each is self-contained.
Classification Metrics
Core concepts
Supervised learning: training a model on labeled data (input → output) to predict outcomes for new data.
Binary classification: predicting one of two classes (e.g. disease present = 1, absent = 0).
Confusion matrix
The foundation for all classification metrics:
- TP (True Positive) - correctly predicted positive cases
- TN (True Negative) - correctly predicted negative cases
- FP (False Positive) - incorrectly predicted positive (Type I error)
- FN (False Negative) - incorrectly predicted negative (Type II error)
Why it matters in the Heart Disease PoC
Multiple models were compared using these metrics. High recall is critical in medical screening (missed cases are costly), but precision matters too (too many false alarms erode trust).
ROC Curve & AUC
ROC curve
A graphical plot of the trade-off between True Positive Rate (Recall) and False Positive Rate at various classification thresholds.
False Positive Rate
\[ FPR = \frac{FP}{FP + TN} \]
AUC (Area Under the Curve)
Measures the model's ability to distinguish between classes.
Why it matters in the Heart Disease PoC
The best-performing internal PoC model reached an AUC around 0.99 on the held-out test set - an internal benchmark result, not a certified clinical performance figure. The ROC curve helps select an operating threshold based on clinical priorities (e.g. prioritizing recall).
Explainability (Feature Importance & SHAP)
Feature importance
Tree-based models (XGBoost, Random Forest) measure how important each feature is for making predictions.
SHAP (SHapley Additive exPlanations)
SHAP values explain individual predictions by showing how each feature contributes to the output.
SHAP visualizations
- Summary plot - feature importance and impact across all samples
- Force / waterfall plot - step-by-step contribution for a single prediction
- Decision plot - how features push a prediction from baseline to output
Why it matters in the Heart Disease PoC
SHAP helps explain why the demo model flags elevated risk - e.g. "elevated ST depression, chest pain type, and exercise-induced angina drove this score." This kind of explanation is central to clinical trust and decision support.
Time Series Basics (Trend, Seasonality, Residual)
Decomposition
STL decomposition
STL (Seasonal and Trend decomposition using Loess) is a robust method that can handle changing seasonal patterns, outliers, and gaps in the data.
Why it matters in the Influenza PoC
Decomposing weekly incidence data revealed clear winter seasonal peaks; the trend component showed multi-year patterns, and residuals helped flag unusual weeks.
ACF, PACF & Lag Features
Autocorrelation function (ACF)
ACF
\[ \rho_k = \frac{\text{Cov}(Y_t, Y_{t-k})}{\text{Var}(Y_t)} \]
Partial autocorrelation (PACF)
Correlation between \(Y_t\) and \(Y_{t-k}\) after removing the effect of intermediate lags - helps identify model order.
Lag features
Lag feature
\[ \text{lag}_k(Y_t) = Y_{t-k} \]
Cross-correlation
Pearson correlation
\[ r = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{\sqrt{\sum (X_i - \bar{X})^2} \sqrt{\sum (Y_i - \bar{Y})^2}} \]
Why it matters in the Influenza PoC
ACF showed strong correlation at lag = 1 week. Cross-correlation between regions such as Śląskie and Mazowieckie was high, suggesting shared nationwide dynamics. Lag features improved short-horizon forecasting.
Stationarity & ADF Test
Stationarity
A time series is stationary if its statistical properties (mean, variance, autocorrelation) remain constant over time. Many classical models (ARIMA) assume stationarity.
Augmented Dickey-Fuller (ADF) test
A statistical test for whether a series has a unit root (is non-stationary).
Why it matters in the Influenza PoC
An ADF test on a reference regional series supported stationarity (p < 0.05), likely because strong seasonality removes the underlying trend - allowing classical models to be used without differencing.
Clustering (K-Means, PCA, Elbow)
K-means clustering
An unsupervised algorithm that partitions data into \(k\) clusters by minimizing within-cluster variance.
Objective (sum of squared errors)
\[ \text{SSE} = \sum_{i=1}^{k} \sum_{x \in C_i} \| x - \mu_i \|^2 \]
Elbow method
Plotting SSE vs. \(k\) - the "elbow" where SSE flattens suggests an optimal cluster count.
PCA (Principal Component Analysis)
A dimensionality-reduction technique that projects data onto orthogonal components capturing maximum variance - used here to visualize high-dimensional weekly series in 2D.
Why it matters in the Influenza PoC
K-means (k = 4) on the 16 regions revealed that provinces cluster by epidemic style (high peaks, flat patterns, frequent fluctuation) rather than by geography - PCA made this visible in two dimensions.
Practical Notes (Limitations & Next Steps)
Heart Disease PoC - takeaways
Input: 1,025 patient records, 13 clinical features. Output: binary risk prediction. Best model: XGBoost (internal PoC benchmark). Key limitations: small sample, no modern biomarkers or imaging, single-center data, no external validation.
Influenza PoC - takeaways
Input: weekly incidence, 16 regions, ~97 weeks. Methods: STL, ACF/PACF, k-means, PCA, ADF, lag features. Key limitations: short horizon, no external covariates (weather, vaccination, mobility), province-level granularity only, no severity data.
Cross-validation & overfitting
Overfitting: a model performs well on training data but poorly on new data. Cross-validation: split data into \(k\) folds, train on \(k-1\), validate on the rest, repeat.
K-fold CV score
\[ \text{CV Score} = \frac{1}{k} \sum_{i=1}^{k} \text{Score}_i \]
Next steps
- Heart Disease: validate on external datasets, add imaging/biomarkers, explore temporal risk modeling.
- Influenza: integrate weather and mobility data, extend to multi-pathogen surveillance.
- General: any real deployment requires rigorous validation, regulatory compliance and integration with existing healthcare infrastructure.