7 routes42 sections324 units

Unit 2.1 · about 2 h

5 / 324

Frame a prediction task and choose a baseline

A model can optimize the wrong target very effectively. Starting with the decision, target, available information and success metric prevents an attractive score from substituting for a useful result.

  • explain
  • derive

You can now

  • State a non-ML product or operational goal before naming an algorithm.
  • Identify one observation, the target cnt and the permitted predictor features.
  • Explain why the task is regression and choose a metric whose units match the decision.
  • Define a simple baseline that any trained estimator must beat.
  • Define the prediction moment as the start of the hour and distinguish calendar inputs known then from observed weather and demand fields that are not yet available.

Covers

  • Prediction tasks, targets and success metrics
  • Prediction-time feature availability

Study, in this order

2 steps

  1. Introduction to Machine Learning Problem Framing
    Introduction to Machine Learning Problem Framing

    Complete the course objectives on ML suitability, problem framing, model output and success metrics.

  2. Bike Sharing Dataset
    Bike Sharing Dataset

    Read the dataset description and variable table. cnt is the target; casual and registered are other variables that compose the target.

Focus on

  • Goal, observation, feature, target and prediction time
  • Regression output and MAE as an interpretable metric
  • A naive baseline before a sophisticated estimator
  • The distinction between a product metric and a model metric
  • Prediction moment: at the start of the hour, before its rentals and observed weather are known

Reproduce closed-book

Write a one-page problem statement for predicting hourly bike demand. State the prediction time at the start of each hour, target, allowed calendar inputs, excluded observed weather and target-derived fields, evaluation metric, baseline and one decision that could use the prediction.

Traps

  • Do not assume ML is necessary when a rule or existing forecast would be better.
  • Do not include values that are only known after the prediction time.
  • Do not select a metric because it is familiar; justify its relation to the task.

Practice

Google ML Problem Framing

Complete the short course and write the goal, model output and success metric for one additional example.

Use the exercise to distinguish predictive ML from generative AI and non-ML approaches.

Self-test

  1. Why is cnt a regression target in the bike-sharing project?

  2. What is a baseline and why should it be measured first?

Completion criterion

Stop when

You can state the product goal, target, prediction moment, allowed calendar inputs, excluded observed fields, regression metric and a simple baseline without referring to a model library.

Mark passed, then open 2.2 Only mark this when you can do it without notes.

Leads to

Comes after

Resources for this unit

  • Bike Sharing Dataset
    UCI Machine Learning Repositoryrequireddataset
    Use the hourly dataset (17,389 records) for a first regression project. Sort chronologically; use 2011 for training and 2012 as the untouched final test period. cnt is the target. Exclude casual, registered, cnt, instant, dteday and yr from the model feature matrix; use dteday only to sort/split.
  • Introduction to Machine Learning Problem Framing
    Google for Developersprimarycourse
    Complete the short course on deciding whether ML fits the problem, framing the model output and choosing success metrics before touching the estimator.

Also in this section

  • Kaggle Learn — Intro to Machine Learning
    Kaggle Learnprimarycourse
    Complete the lessons on how models work, data exploration, the first model, model validation, underfitting/overfitting and random forests. Reproduce the exercises in a fresh notebook.
  • Google Machine Learning Crash Course
    Google for Developersrequiredcourse
    Use the modules on regression, numerical and categorical data, datasets/generalization/overfitting, and classification metrics as a structured conceptual companion. The course is free and includes interactive exercises.
  • Pipelines and composite estimators
    scikit-learnrequireddocumentation
    Study Pipeline and ColumnTransformer. Keep preprocessing inside the pipeline so transformations are fitted only on the training partition and applied consistently at evaluation time.
  • Common pitfalls and recommended practices
    scikit-learnrequireddocumentation
    Read the sections on inconsistent preprocessing and data leakage. Use the wrong/right examples to audit the project before trusting the reported test score.
  • TimeSeriesSplit
    scikit-learnreferencedocumentation
    Read why ordinary cross-validation can train on future observations and evaluate on the past. The starter project uses one chronological year holdout; use TimeSeriesSplit when extending it to repeated time-aware validation.
  • Model evaluation: regression metrics
    scikit-learnreferencedocumentation
    Use the regression metric definitions for MAE, MSE/RMSE and R-squared. Explain the units and limitations of each metric instead of reporting a score without context.
  • Machine Learning in Python with scikit-learn (MOOC)
    Inriasupportcourse
    Use as the free, more thorough follow-on after this guided first model. Its static course and notebooks are openly available; the materials are published under CC BY.
  • Model persistence
    scikit-learnreferencedocumentation
    Read the security and version-compatibility warnings before saving an estimator. Treat the training code, package versions, data split and metrics as the reproducible artifact, not just a serialized model file.

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels