← All posts

Scikit-Learn Algorithm Cheat Sheet — Clinical Epidemiology Edition: Choosing the Right ML Type

Clinical Epidemiology ResearchUniqcret doctor knowledgesData Analytics or StatisticsMethodology and Research DesignData-Sci & Digital Health
On this page

Scikit-learn Machine Learning Algorithm Map
Image source: scikit-learn.org
ⓒ Original publisher. Displayed via hotlinking for educational fair use; fallback to archived copy if unavailable.

🟡 START

You begin by asking:

What kind of problem am I trying to solve in my study?

Common scenarios in clinical epidemiology:


🔹 1. Do you have labeled data?


🟩 2. Supervised Learning

If you have labeled data, your goal is to predict an outcome.

What are you predicting?


🟥 3. Classification (Predicting a Category)

Goal: Predict discrete outcomes — e.g., disease / no disease, high-risk / low-risk.

a. Do you have text data (e.g., clinical notes, discharge summaries)?

b. <100K samples?

c. Are you using kernel approximation (non-linear patterns)?


🟦 4. Regression (Predicting a Quantity)

Goal: Predict a continuous variable — e.g., lab value, survival time, hospital stay.

a. More than 50 samples?

b. <100K samples?

c. Should few features be important?


🟪 5. Unsupervised Learning

If you don’t have labeled outcomes, you’re exploring hidden structures or relationships.

Are you just exploring patterns?


🟨 6. Dimensionality Reduction

Goal: Simplify large feature sets into fewer meaningful components.

a. <10K samples?

b. Using kernel approximation (non-linear data)?


🟫 7. Clustering

Goal: Group similar patients (unsupervised).

a. <10K samples?

b. Number of categories known?

c. <10K samples?


🔁 Summary by Problem Type (Clinical Examples)

Problem TypeAlgorithmClinical Epidemiology Example
ClassificationNaive Bayes, Linear SVC, KNeighbors, SGD, SVC, EnsemblePredict diabetes diagnosis, detect pneumonia in radiology notes
RegressionLasso, ElasticNet, Ridge, SVR, EnsemblePredict HbA1c, BP, or survival time
ClusteringKMeans, MeanShift, VBGMMFind phenotypes of chronic kidney disease or sepsis subtypes
Dim. ReductionPCA, Isomap, LLE, Spectral EmbeddingSummarize 100 biomarkers into 2 latent factors
Text Data (special)Naive Bayes, SVMDetect adverse drug events in clinical notes

Practical Clinical Examples — Choosing the Right ML Type

Clinical QuestionML TypeExample Algorithm(s)Why / Notes
🩺 “Can we predict which hypertensive patients will develop stroke?”ClassificationRandomForestClassifier, LogisticRegression, SupportVectorClassifier (SVC)Outcome is categorical (Yes/No). Models predict probability of stroke occurrence.
🏥 “Which factors best predict hospital stay length?”RegressionRandomForestRegressor, Lasso, ElasticNet, RidgeRegressionOutcome is continuous (days). Regularized regressions highlight key predictors; Random Forest can handle non-linear relationships.
💨 “Can we find subgroups of COPD patients with similar symptoms?”Clustering (Unsupervised)KMeans, GaussianMixtureModel (GMM), MeanShift, VBGMMNo labels — the goal is to discover hidden phenotypes or patient subgroups.
🧬 “Can we reduce 300 lab markers into a few composite risk factors?”Dimensionality ReductionPCA, Isomap, t-SNE, LLE, SpectralEmbeddingReduce many correlated biomarkers to fewer components for visualization or downstream analysis.
📝 “Can we automatically identify mentions of adverse drug events in notes?”Text Classification (NLP)NaiveBayes, LinearSVC, LogisticRegression (with TF-IDF)Text data with labeled outcomes; algorithms classify notes mentioning adverse drug events.
🧠 “Can we predict which ICU patients will deteriorate within 24 hours?”Classification (Time-series)GradientBoostingClassifier, XGBoost, LSTM (if temporal)Binary outcome (deteriorate vs stable). Uses time-based features from EHR.
💵 “Can we estimate total hospital cost per patient?”RegressionRandomForestRegressor, XGBoostRegressorContinuous numeric outcome (cost). Captures nonlinear effects of demographics and clinical variables.
⚕️ “Can we group diabetic patients by treatment response patterns?”Clustering (Phenotyping)KMeans, Hierarchical Clustering, DBSCANNo known labels. Unsupervised grouping to discover response phenotypes.
🧩 “Can we visualize overall patient similarity based on 100 variables?”Dimensionality Reduction (Visualization)PCA, UMAP, t-SNEHelps visualize complex data in 2D/3D space — e.g., to show clusters of similar patients.
💊 “Does a specific drug reduce mortality in COVID-19 patients?”Causal Inference (not pure ML)PropensityScoreMatching, TargetedMaximumLikelihood (TMLE), Double Machine LearningSeeks causal effect, not prediction — integrates ML for confounder adjustment.

⚕️ How This Helps in Clinical Epidemiology

0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment