Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Coding Session

Objectives

In this coding session you carry the data designated for the statement through the full course pipeline, from acquisition to a served model. By the end, you should be able to:

Work independently and manage your own progress within the announced duration. The data details and the practice sources appear in the final section.

Session Rules

All explanations, reasoning, and conclusions belong in the notebook you deliver, and the notebook falls under the same rules as every other deliverable.

Good luck!

Task 1: Data Acquisition

Acquire the data from the source you are given:

  1. Acquire the records the source offers. When the source exposes an API, drive it programmatically: request every needed record and each field you plan to use in the working table, respect the rate limits, and retry a failed request a limited number of times before logging and skipping it.

  2. Keep the identifying keys of each record, so the working table can trace every row back to its source record.

  3. Verify the acquired record count against the source. Keep a log of the successes and the failures with short error messages.

Acquisition and transformation run as one automated pass.

Task 2: Tabular Transformation and Data Quality

Building the working table

Starting from the acquired records, write code that:

  1. Uses every acquired record that belongs to the assignment.

  2. Derives the working columns from the fields the records carry, choosing the schema yourself unless the instructors specify one, and covering the attributes the later tasks need.

  3. Writes the result to one or more CSV files with the columns you chose, unless the instructors specify the files or the schema.

Document in the code how each column is derived. Handle empty values, missing fields, and partial responses deliberately, because the quality of the table limits every later result.

Assessing data quality

With the table in place, assess it:

Task 3: Exploratory Data Analysis

With the working table, explore the data by answering guiding questions of your own, for example about the variables of interest, about single variables, or about relationships between variables.

Choose summaries and plots that fit the variables and the relationship under examination, and implement them in the notebook. Interpret every main question and major pattern in writing, saying what the evidence shows, why it matters, and which limitations apply.

The notebook carries at least two significant insights, unless the instructors specify otherwise.

Task 4: Modeling and Evaluation

Modeling

Prepare the working table for a supervised learning task, choosing classification or regression from the target column. Where the instructors specify the problem, the models, or the metrics, follow that guidance. Otherwise choose what best suits the data and justify each choice in the notebook.

Evaluation

Score every model on the prepared outputs. Common choices include:

Metric blockWhat to report
Performance overviewAccuracy for classification, or the relevant error summary otherwise, with a confusion-matrix heatmap where class labels exist.
Task reportMacro precision, recall, and F1-score for classification, or error measures such as MAE and RMSE and the coefficient of determination for regression.
DiscriminationMacro ROC-AUC from the predicted class probabilities, for classification.

Compare the models across the metrics, explain the errors the overview shows, discuss the plausible causes, for example class imbalance, overlapping classes, or outliers, and recommend the model or models to keep.

Task 5: Serving the Winning Model

Submission

The assignment is completed in one Google Colab notebook. It contains:

Running the notebook from top to bottom reproduces every graded result, down to the serving route. Re-run it that way before submission so every cell carries its executed output and the delivered link opens in a working state. Submit a single link to the runnable notebook through Moodle.

Assessment

No.DetailsScore
1Data acquisition20%
2Tabular transformation and data quality20%
3Exploratory data analysis, at least two significant insights25%
4Learning pipelines, evaluation, and comparison25%
5Serving the winning model10%

The Data

The data for this assignment comes from the instructors, and its contents and delivery can vary. Read the data as it is provided.

Practice sources

The following public sources are suitable for practice:

SourceKindAddressPractice fit
OpenAlexBatchhttps://openalex.orgJSON records over HTTP for Tasks 1 through 3
World Bank data APIBatchhttps://data.worldbank.orgJSON records over HTTP for Tasks 1 through 3
UCI Machine Learning RepositoryBatchhttps://archive.ics.uci.eduTabular sets with a target column for Tasks 2 through 4
OpenMLBatchhttps://www.openml.orgTabular sets with a target column for Tasks 2 through 4
Kaggle datasetsBatchhttps://www.kaggle.com/datasetsTabular sets with a target column for Tasks 2 through 4
Hugging Face datasetsBatchhttps://huggingface.co/datasetsTabular sets with a target column for Tasks 2 through 4
Open-MeteoLivehttps://open-meteo.comRefreshing weather records with rate limits to respect, snapshots feed Tasks 2 through 4
FrankfurterLivehttps://frankfurter.appRefreshing exchange rates, snapshots feed Tasks 2 through 4
CoinGeckoLivehttps://docs.coingecko.comRefreshing crypto market data, snapshots feed Tasks 2 through 4