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:
Acquire the designated data source faithfully.
Turn the acquired records into a working table.
Assess the quality of the working table.
Explore the table and justify at least two significant insights.
Train and evaluate learning pipelines, and serve the best one.
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¶
This is an individual assignment, and all work is your own. When the work is taken under supervision, the sitting runs for the duration announced for it.
This is an open-book assignment, and the course slides may be consulted during it.
Because this work is done without AI assistance, all AI tools and code copilots are strictly prohibited while you work on it. A second warning deducts half of the score, and a third warning deducts the entire score.
Plagiarism, dishonesty, or any other misconduct means a grade of zero for the course.
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:
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.
Keep the identifying keys of each record, so the working table can trace every row back to its source record.
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:
Uses every acquired record that belongs to the assignment.
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.
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:
Choose several relevant quality aspects, such as correctness, completeness, consistency, timeliness, and interpretability, and state how the columns of the table measure each one.
Support the assessment with quantitative summaries or simple visualizations, for example missing-value counts and the share of affected rows.
Conclude with the main issues, their likely impact on the later tasks, and the mitigation you would recommend.
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.
Split the table into training and testing sets at an 80/20 ratio, keep the class distribution of both sides close through stratification where class labels apply, and fix
random_state=42.Preprocess strictly inside a
Pipelinewith aColumnTransformer. Encode categorical features and scale numerical ones where useful. Manual preprocessing outside the pipeline is not allowed.Train at least two distinct models for the chosen task, each as an end-to-end pipeline.
Keep each model’s test-set predictions: class labels and class probabilities for classification, raw predictions otherwise.
Evaluation¶
Score every model on the prepared outputs. Common choices include:
| Metric block | What to report |
|---|---|
| Performance overview | Accuracy for classification, or the relevant error summary otherwise, with a confusion-matrix heatmap where class labels exist. |
| Task report | Macro precision, recall, and F1-score for classification, or error measures such as MAE and RMSE and the coefficient of determination for regression. |
| Discrimination | Macro 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¶
Take the winning pipeline from Task 4, save it, and load it back, so the saved object is the end-to-end pipeline rather than a bare estimator.
Wrap it in a Gradio interface that takes the feature inputs and returns the predicted output.
Unless the instructors specify the serving route, choose the route that fits the environment. Launch the interface from the notebook or publish it as a Hugging Face Space through the Gradio SDK. Record the reachable link in the notebook.
Submission¶
The assignment is completed in one Google Colab notebook. It contains:
the code for the five tasks, runnable from first cell to last,
the interpretations and conclusions in markdown cells,
the CSV files of Task 2,
the serving route in play, with the reachable link recorded, including the published Hugging Face Space where applicable.
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. | Details | Score |
|---|---|---|
| 1 | Data acquisition | 20% |
| 2 | Tabular transformation and data quality | 20% |
| 3 | Exploratory data analysis, at least two significant insights | 25% |
| 4 | Learning pipelines, evaluation, and comparison | 25% |
| 5 | Serving the winning model | 10% |
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:
| Source | Kind | Address | Practice fit |
|---|---|---|---|
| OpenAlex | Batch | https:// | JSON records over HTTP for Tasks 1 through 3 |
| World Bank data API | Batch | https:// | JSON records over HTTP for Tasks 1 through 3 |
| UCI Machine Learning Repository | Batch | https:// | Tabular sets with a target column for Tasks 2 through 4 |
| OpenML | Batch | https:// | Tabular sets with a target column for Tasks 2 through 4 |
| Kaggle datasets | Batch | https:// | Tabular sets with a target column for Tasks 2 through 4 |
| Hugging Face datasets | Batch | https:// | Tabular sets with a target column for Tasks 2 through 4 |
| Open-Meteo | Live | https:// | Refreshing weather records with rate limits to respect, snapshots feed Tasks 2 through 4 |
| Frankfurter | Live | https:// | Refreshing exchange rates, snapshots feed Tasks 2 through 4 |
| CoinGecko | Live | https:// | Refreshing crypto market data, snapshots feed Tasks 2 through 4 |