* Total Points: 0
Back to Lessons Features, Labels, and the Data Pipeline 0 pts Module 1 · Lesson 4
Introduction

Features, Labels, and the Data Pipeline

You already know this stuff -- you just don't know the ML words for it

The Setup

You have built REDCap databases. You have created Table 1. You have selected predictor variables for a logistic regression. You have been doing this all along -- ML just uses different words for the same concepts.

This lesson is a translation exercise. By the end, you will be able to read an ML methods section and know exactly what they did to your data before feeding it to the algorithm.

The language barrier

Your data science collaborator says:

"We extracted 35 features from the registry, imputed missing values using multiple imputation, one-hot encoded the categorical variables, scaled the continuous features, and split the data into training, validation, and test sets at 60/20/20."

If that sounds like a foreign language, it is not -- it is just clinical research with different vocabulary. Let's translate it.

If you can build a REDCap database, you understand 80% of what "data pipeline" means. This lesson covers the other 20%.

The Rosetta Stone: ML Jargon to Clinical Research

Every ML term maps to something you already understand. Tap each card for details.

Features
Your predictor variables. The columns in your dataset that go into the model.
Input
What it means
Features are the variables the model uses to make predictions. In clinical terms: your independent variables, your covariates, the columns of Table 1. Age, sex, comorbidities, lab values, anatomic measurements -- these are all features.
What you already do
When you build a REDCap form and decide what data to collect, you are selecting features. When you choose which variables go into a multivariable regression, you are performing feature selection.
Vascular example: For a model predicting 30-day mortality after EVAR, the features might include: age, sex, aneurysm diameter, neck length, neck angle, access vessel diameter, eGFR, history of COPD, ASA class, and urgency of repair.
Tap to expand
Labels
Your outcome variable. What the model is trying to predict.
Output
What it means
The label is the answer the model is trying to learn. In clinical terms: your dependent variable, your endpoint, your outcome. For supervised learning, every row in your training data needs a label -- a known answer for the model to learn from.
What you already do
When you define your primary endpoint in a study protocol, you are choosing the label. "30-day mortality" is a binary label. "Length of ICU stay" is a continuous label. Unsupervised learning (clustering) has no label -- that is what makes it unsupervised.
Vascular example: For a model predicting graft patency after infrainguinal bypass, the label is "primary patency at 1 year" (yes/no). The features are everything else -- conduit type, runoff score, indication, target vessel, patient comorbidities.
Tap to expand
Feature Engineering
Creating new variables from raw data to help the model learn.
Transform
What it means
Feature engineering is the process of creating new, more informative variables from raw data. This is often the most impactful step in building an ML model -- the right features can matter more than the choice of algorithm.
What you already do
You do this constantly. When you calculate BMI from height and weight, you are engineering a feature. When you derive a WIfI composite stage from wound, ischemia, and foot infection grades, you are engineering a feature. When you count the number of prior revascularizations from a procedure list, you are engineering a feature.
Vascular example: From a raw operative dataset, a researcher creates: "number of prior ipsilateral interventions" (count from procedure history), "ABI delta" (postop ABI minus preop ABI), and "multilevel disease" (binary flag: disease in both inflow and outflow segments). None of these existed in the original data -- they were engineered.
Tap to expand
Preprocessing
Cleaning and formatting data so the algorithm can use it.
Prepare
What it includes
Preprocessing covers all the data cleaning and transformation steps that happen before the model sees the data. This includes handling missing values (imputation), converting categories to numbers (encoding), and putting variables on a common scale (scaling/normalization).
Key techniques
Imputation: Filling in missing lab values or measurements using statistical methods (mean, median, or more sophisticated approaches like multiple imputation). Encoding: Converting "autologous vein / prosthetic / composite" into numbers the algorithm can process -- often by creating separate binary columns for each category (one-hot encoding). Scaling: Putting age (20-90) and creatinine (0.5-12) on the same scale so the algorithm treats them fairly.
Vascular example: In a VQI dataset for bypass outcomes, preprocessing might involve: imputing missing preoperative ABI values (15% missing), one-hot encoding conduit type into three binary columns (vein=1/0, prosthetic=1/0, composite=1/0), and scaling continuous variables like age and BMI to have mean=0 and standard deviation=1.
Tap to expand
!

The Quick Translation

ML Term Clinical Research Term
Feature Predictor variable / covariate
Label Outcome / endpoint
Feature engineering Deriving new variables (BMI, composite scores)
Imputation Handling missing data
Encoding Converting categories to numbers
Scaling Standardizing variable ranges
Training set Derivation cohort
Test set Validation cohort

The Data Pipeline: What Happens Before Modeling

Your collaborator does not just dump raw data into an algorithm. Here is what actually happens -- walked through with a vascular surgery dataset.

The dataset

Imagine 2,500 patients who underwent open AAA repair, pulled from a multi-center registry. You want to predict prolonged ICU stay (>3 days). Your Table 1 has 20 columns.

Step 1: Define Features and Label
Separate your columns into features (predictors) and the label (outcome). Here, the label is "ICU stay >3 days" (yes/no). The 19 remaining columns are features.
Clinical parallel: choosing your outcome and covariates for a multivariable model.
Step 2: Handle Missing Data (Imputation)
Preoperative albumin is missing in 18% of patients. eGFR is missing in 6%. Your collaborator uses multiple imputation to fill in plausible values based on the other variables, rather than deleting those patients.
Clinical parallel: you have done this in traditional statistics. Same concept, same methods.
Step 3: Encode Categorical Variables
Aneurysm extent (type I-IV) becomes four binary columns. ASA class (II, III, IV) becomes three binary columns. This is "one-hot encoding" -- each category gets its own column with a 1 or 0.
Clinical parallel: creating dummy variables for regression. Exactly the same thing.
Step 4: Scale Continuous Variables
Age ranges from 55 to 88. Aneurysm diameter ranges from 5.0 to 12.5 cm. Creatinine ranges from 0.7 to 8.2. Some algorithms perform better when these are all on a similar scale (mean=0, SD=1).
Clinical parallel: standardization, which you may have seen in meta-analyses.
Step 5: Split the Data
Training set (60%): The model learns patterns from these 1,500 patients. Validation set (20%): Used to tune the model and prevent overfitting -- the model never trains on this data. Test set (20%): Held out until the very end. The performance you report comes from here.
Clinical parallel: derivation and validation cohorts. The key difference is three sets instead of two -- the validation set acts as a "practice test" before the real final exam.

Why Three Splits, Not Two?

In traditional statistics, you often have a derivation cohort and a validation cohort (two splits). ML adds a third -- the validation set -- because ML models have many tunable settings ("hyperparameters"). If you tune those settings using your test set, you are inadvertently optimizing for that specific data. The validation set lets you tune without contaminating the final evaluation. Think of it as: training = studying, validation = practice exam, test = board exam.

Data Leakage: The Silent Study-Killer

Data leakage occurs when information from outside the training set sneaks into the model during training. The most common form: using the entire dataset to impute missing values or scale features before splitting. This means the training set has "seen" patterns from the test set. Your collaborator should preprocess each split independently. If a paper reports preprocessing on the full dataset before splitting, that is a red flag.

The data pipeline is not glamorous, but it is where most ML projects succeed or fail. A good pipeline with a simple model usually beats a bad pipeline with a fancy algorithm.

Exercise: Translate the Jargon

Read the scenario. Identify the correct ML concept.

Scenario 1 of 4

Lesson Complete!

0
Total Points Earned
Scenarios (0/4 correct) +0 pts
Lesson Completed +100 pts

Features, Labels, and the Data Pipeline

Module 1 - Lesson 4 complete

Key Takeaways

  • Features = predictor variables: The columns that go into the model. Everything in Table 1 except the outcome.
  • Labels = outcomes: What the model is trying to predict. The dependent variable. Supervised learning requires labels; unsupervised does not.
  • Feature engineering creates new variables: Deriving composite scores, counts, or transformations from raw data. Often the most impactful step in the entire pipeline.
  • Preprocessing cleans and formats: Imputation fills missing values, encoding converts categories to numbers, scaling standardizes ranges. These must happen on each data split independently to avoid leakage.
  • Three splits, not two: Training (learn), validation (tune), test (report). The validation set prevents you from inadvertently optimizing for the test data.

You can now decode ML methods sections. Features, labels, preprocessing, data splits -- these are not new concepts. They are your old concepts with new names. One lesson left: knowing when to use ML at all.