Machine Learning (ML) · Intermediate level

Intermediate level · Module 1: Feature Engineering and Pipelines · Lesson 2 of 3

Creating Features

Turn raw data into informative features using dates, ratios, aggregates and domain knowledge.

In this lesson you will

  • Create date, ratio and aggregate features
  • Judge whether a new feature helps using validation

Key concepts

feature engineeringdate partsrolling and grouped aggregatesdomain knowledge

The lesson

Raw columns are rarely the best inputs. From a date you can derive day of week, month and whether it is a holiday or market day; from transaction history, the average of the last seven days.

Ratios often carry more meaning than raw numbers: cash withdrawn relative to float held says more about an agent's risk than either number alone.

Every new feature should earn its place. Compare validation performance with and without it, and make sure it would be available at prediction time — features computed from future data are leakage.

Step by step

  1. Create day-of-week and month features.
  2. Create a seven-day rolling average of withdrawals per agent.
  3. Create a withdrawals-to-float ratio.
  4. Compare validation scores with and without the new features.

Practice activity

Engineer at least five features for the agent data and report which ones improved validation performance.

Expected result: A feature list with the validation evidence for each one kept.

Check your understanding

  1. Why can a ratio be more useful than raw values?

    Show answer

    It captures the relationship that matters, such as demand relative to capacity.

  2. What must be true of every feature at prediction time?

    Show answer

    It must be available then, without using future information.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.