Skip to course content
Free course

Machine Learning Foundations / Module 2

Module 2 lesson

Rows, Features, Labels, and Timing

Unit ID: ML-M02-U01 Estimated active time: 25-30 minutes

The four basic questions

When you see a modelling dataset, ask four questions first.

  1. What does one row represent?
  2. What is the target or label?
  3. Which columns could be features?
  4. When is each value known?

These questions protect you from many modelling mistakes.

Row

In the Module 2 dataset, one row is:

One fictional learner's first Module 1 attempt.

This is the unit of analysis.

If one row were a lesson view instead, the project would be different. If one row were a support ticket, it would be different again.

Target or label

The target is:

completed_module1_by_day10

This is the value a later supervised model may try to predict.

The target is recorded after the outcome window. That is correct. A target often comes from the future. But a target is not a feature.

Feature candidate

A feature candidate is a column we may use as input to a model.

For a day-3 prediction, columns such as day3_lessons_opened and day3_practice_attempts are possible feature candidates because they are known by the prediction time.

Columns such as final_quiz_score are not feature candidates for this project because they happen later.

Timing

Timing is one of the simplest ways to catch leakage.

Use this question:

Would this value be known at the moment the prediction is made?

If the answer is no, exclude it from features.

Practice

Create a column-role table with these roles:

  • metadata;
  • feature candidate;
  • target;
  • exclude future information;
  • proxy-risk review.

Do not worry about modelling yet. Your job is to label the evidence.

Takeaway

Rows, labels, features, and timing define what the dataset can honestly support. In the next unit, you will classify columns by data type and role.