Introduction to Machine Learning for Health Analytics

AI is the broad field of creating computer systems that perform tasks normally requiring human intelligence. These tasks include:
Machine learning is a subset of AI that focuses on systems that learn patterns from data
AI is used across the healthcare system to:
Predict outcomes: e.g. complications, readmissions, mortality
Support diagnosis e.g. image interpretation, risk scoring
Personalise treatment matching patients to therapies
Improve operations: scheduling, staffing, capacity planning
| Tool | Used for | Used by |
|---|---|---|
| Aidoc | Facilitating early disease detection and minimizing diagnostic errors | Hospitals |
| Shift Technology | Streamlining claims processing and fraud detection | Insurance companies |
| Atomwise | Identifying potential drug candidates and predicting their efficacy | Drug development |
| BenevolentAI | Decreasing the time and expense associated with bringing new treatments to market | Drug development |
| Digital Diagnostics | Detecting conditions such as diabetic retinopathy and skin cancer from medical images | Diagnostics |
| PathAI | Achieving results comparable to those of experienced clinicians in diagnostics | Diagnostics |
| Qventus | Enhancing operational efficiency using AI-powered predictive analytics | Healthcare facilities |
| LeanTaaS | Optimizing resource allocation and reducing operational costs | Healthcare facilities |
Source: DataCamp, “AI in Healthcare”
https://www.datacamp.com/blog/ai-in-healthcare
Source: Wonseok Shin
A collection of R packages for statistical modelling and machine learning.
Follows the {tidyverse} principles.
install.packages("tidymodels")

recipe)Open health_analytics_09_ml.Rmd for prompts.
Load the data Read in the bdiag.csv data
Explore the data
Inspect variables, plot correlations between different variables
Estimate a vanilla logit
Look at what goes wrong!
Standard regression: chooses \(\beta\) coefficients to minimize prediction error
Least Absolute Shrinkage and Selection Operator (LASSO): adds a penalty for using large or many coefficients: \[ \min_{\beta} \; \text{Loss}(\beta) \;+\; \lambda \sum_j |\beta_j| \]
Loss function depends on model choice:
Key difference
Some parts of a model are not learned directly from the data.
Model parameters (e.g. coefficients \(\beta\))
→ estimated during training
Hyperparameters (e.g. \(\lambda\) in LASSO)
→ chosen by the researcher → usually try out a variety of values and test their performance using `cross-validation’ on different splits of the training data → control how the model learns
Hyperparameters affect model complexity and overfitting!
| Predicted 1 | Predicted 0 | |
|---|---|---|
| Actual 1 | True Positive (TP) | False Negative (FN) |
| Actual 0 | False Positive (FP) | True Negative (TN) |

Source: Martin Thoma (Wikipedia)
logistic_reg().A tree-like model of decisions and their possible consequences.

An ensemble method
Combines many decision trees.
Can be used for classification or regression problems.
For classification tasks, the output of the random forest is the class selected by most trees.

Source: Tse Ki Chun (Wikimedia)
trees: number of trees in the ensemble.
mtry: number of predictors that will be randomly sampled at each split when creating the tree models.
min_n: minimum number of data points in a node that are required for the node to be split further.
Specify a random forest model using rand_forest()
Tune the hyperparameters using the cross-validation folds.
Fit the final model and evaluate it.