KatInterview

Building a Binary Classifier for Clinical Risk Prediction

Machine LearningModel answer
HardModel answerMachine Learningclassificationfeature-engineeringhealthcare

Last updated

Design and implement a complete machine learning pipeline to predict a binary medical outcome from tabular patient data.

You have a dataset of patient records with clinical measurements and a binary outcome indicating whether each patient developed a cardiovascular condition. The dataset includes features such as age, height, weight, blood pressure readings, cholesterol levels, smoking history, and similar health indicators.

Your task is to build a complete machine learning workflow in Python using pandas, scikit-learn, and visualization libraries. Demonstrate how you would:

  1. Load the data and perform an initial inspection to understand its structure and quality
  2. Identify and address data quality issues including missing values, duplicates, and physiologically implausible measurements
  3. Conduct exploratory analysis to understand feature distributions and their relationship to the outcome
  4. Create derived features that might improve predictive power
  5. Build and validate a baseline binary classification model using appropriate train/test methodology
  6. Select and compute evaluation metrics suitable for this problem domain
  7. Discuss what additional validation steps would be necessary before deploying such a model in a healthcare setting

Assume you have access to standard Python data science and machine learning libraries. Focus on demonstrating sound ML practices, particularly around data leakage prevention, appropriate metric selection for imbalanced medical problems, and handling of missing clinical data.

Hints

Hint 1

Consider which metrics matter most when false negatives and false positives have different real-world costs in medical screening

Hint 2

Imputation parameters must be learned from training data only to avoid leakage—structure your code to enforce this

Hint 3

Clinical measurements have known physiologically valid ranges; use these to detect measurement errors rather than silently accepting outliers