ML Zoomcamp Midterm Project: A Hands-On Stroke Prediction System

An ML Zoomcamp learner demonstrates the full end-to-end ML workflow and key challenges using stroke prediction.
The article introduces a midterm project completed by a learner in DataTalksClub's free bootcamp ML Zoomcamp — a stroke risk prediction system. It explains the background and breaks down three core technical components: handling class imbalance and missing values in medical data, model selection and evaluation from logistic regression to XGBoost, and deployment with Flask, FastAPI, or Streamlit. It concludes with takeaways for ML learners on topic significance, preprocessing, metric selection, and end-to-end delivery.
A Machine Learning Practice Project Worth Noticing
In the Reddit community, a learner shared their ML Zoomcamp 2026 midterm project — a stroke prediction system. ML Zoomcamp is a free machine learning bootcamp offered by DataTalksClub that emphasizes hands-on practice and project-driven learning. The midterm project requires learners to independently build an end-to-end machine learning application, from data processing to model deployment. This learner chose stroke prediction as the topic, which is both practically meaningful and covers typical challenges in classification tasks.

Project Background and Motivation
Stroke is one of the leading causes of disability and death worldwide, and early risk prediction is critical for intervention and treatment. Using machine learning models to identify high-risk individuals from clinical features is an active research direction in health informatics. As a midterm assignment, this project aims to demonstrate the learner's mastery of the complete machine learning workflow: data acquisition and cleaning, exploratory analysis, feature engineering, model training and evaluation, and finally application packaging.
Although the original post did not provide a detailed tech stack or dataset source, judging from the project name and common practice, the learner most likely used a public stroke dataset (such as the commonly seen Stroke Prediction Dataset on Kaggle) and built classification models (such as logistic regression, random forest, or gradient boosted trees) to predict whether an individual would experience a stroke.
ML Zoomcamp is a free online machine learning bootcamp run by DataTalksClub since 2021. The course typically lasts 3–4 months and covers modules such as linear regression, classification, evaluation metrics, decision trees and ensemble models, neural networks, serverless deployment, containerization (Docker), and Kubernetes. Its defining feature is the progressive "module—homework—project" structure: after each module learners must submit a corresponding homework, and at stages along the way there are midterm and final projects that require learners to chain the capabilities of multiple modules into a runnable, accessible application. The course does not enforce attendance, learning progress is self-paced, and the certificate of completion is generally conditional on completing the required projects. This deliverable-oriented design enables learners to directly demonstrate end-to-end engineering ability when job hunting or changing roles, rather than merely having a history of solving practice problems.
Breaking Down the Core Technical Components
Data Preprocessing and Feature Engineering
Medical data commonly suffers from class imbalance, missing values, and differences in feature scales. Stroke prediction datasets often have a highly skewed ratio of positive to negative samples, and how to handle imbalance becomes key to model success. Common strategies include resampling (oversampling/undersampling), adjusting class weights, or using evaluation metrics suited to imbalanced data (such as F1 score, AUC-ROC). In terms of feature engineering, age, hypertension, heart disease, average glucose level, BMI, and smoking status are common predictors, and binning continuous variables, one-hot encoding, and standardization are necessary steps.
Class imbalance refers to the situation in binary classification where the numbers of positive and negative samples differ significantly. In stroke datasets, those who experience the event often account for only a minority (commonly single digits to the low teens as a percentage), and if a model simply classifies all samples as "no risk," accuracy can still be high — therefore accuracy is almost meaningless as a reference in such scenarios. More appropriate metrics include: recall (concerned with missed diagnoses), precision, F1 (the harmonic mean of the two), and AUC-ROC (measuring ranking ability, insensitive to threshold). In terms of handling methods, undersampling may lose information from the majority class, oversampling easily leads to overfitting, and synthetic sampling such as SMOTE can interpolate within the feature space to generate minority-class samples; alternatively, one can keep the data unchanged and instead use class_weight='balanced' or set scale_pos_weight in a boosting framework. In practice this usually needs to be combined with stratified cross-validation to ensure the positive-to-negative ratio is consistent across each fold.
Model Selection and Evaluation
For binary classification tasks, logistic regression is often used as a baseline model due to its interpretability, while ensemble methods (random forest, XGBoost) often provide better predictive performance. When evaluating, note that one cannot rely on accuracy alone, especially in class-imbalanced scenarios. Cross-validation and holdout-set testing are standard practices to ensure model generalization. The original post did not disclose specific metrics, but a good midterm project should demonstrate multi-model comparison and a reasonable evaluation process.
Application Deployment and Interaction
ML Zoomcamp emphasizes model deployment, and learners usually need to package a trained model as a web service or interactive interface. Flask, FastAPI, or Streamlit are common choices. After users input clinical features, the system outputs a stroke risk prediction result. The deployment stage tests the learner's ability to move a model from a notebook to an accessible service, including API design, input validation, and error handling.
Flask, FastAPI, and Streamlit target different scenarios. Flask is a lightweight WSGI framework that is flexible but requires handling input validation and documentation yourself; FastAPI automatically performs request-body validation (Pydantic) based on type annotations and generates OpenAPI interactive documentation, making it suitable for building standardized inference APIs; Streamlit builds interactive interfaces quickly in a script style, generating forms and charts in just a few lines of code, but has limited support for high-concurrency production and fine-grained frontend control. The common deployment path in ML Zoomcamp is: expose a /predict endpoint with Flask/FastAPI, package the image with Docker, then deploy to a cloud platform, thereby turning the model in the notebook into a service callable via HTTP. During deployment, engineering details such as model loading timing, dependency version locking, input range validation, and exception return codes also need attention.
Takeaways for Learners
This project shows how machine learning beginners can turn classroom knowledge into a real piece of work. For readers also learning ML, several things can be drawn from it: choosing a topic with social significance can enhance the project's value; paying attention to data preprocessing and imbalance handling; using appropriate metrics when evaluating; and completing the full process from data to deployment. Although the original post provides limited information, the direction and structure of the project itself are worth referencing.

Conclusion
As a midterm project, the stroke prediction system covers the main stages of the machine learning workflow and is a good vehicle for testing learning outcomes. We look forward to the learner sharing more detailed technical implementation and project results in the future.
One-line Summary
An ML Zoomcamp learner uses stroke prediction as an example to demonstrate the complete workflow and key challenges of an end-to-end machine learning project.
Paragraph Summary
The article introduces a midterm project completed by a learner in DataTalksClub's free bootcamp ML Zoomcamp — a stroke risk prediction system. The author first explains the project background: stroke prediction has practical significance, and the midterm project requires learners to independently complete the full process from data processing to deployment. It then breaks down three core technical components: the class imbalance, missing values, and scale differences common in medical data, along with countermeasures such as resampling, class weights, and F1/AUC; model selection and evaluation points from a logistic regression baseline to random forest and XGBoost; and deployment practice using Flask, FastAPI, or Streamlit to package the model and provide interactive risk prediction. Finally, it summarizes the reference value of this project for ML learners, emphasizing topic significance, preprocessing quality, metric selection, and end-to-end delivery ability.
Related articles

Inside Honey Trap Training: Emotional Dissociation and Anchoring Techniques
How are spies trained for honey trap missions? A trainee reveals emotional dissociation, perfume and keyword anchoring, and target photo binding—psychological techniques that condition reflexes for intelligence work.

Frontier AI Risk Management: Full-Pipeline Practices from Training to Deployment
OpenAI outlines a frontier AI risk management framework: from training-stage model alignment to deployment-stage sandboxing and blocking safeguards, plus post-deployment monitoring—a layered risk control system across the model lifecycle.

DaisyRose-27B: 1,200-Task RL Boosts Qwen3.8 from 5.6% to 12% on Terminal-Bench 4.1
DaisyRose-27B uses RL training on 1,200 tasks to boost Qwen3.8's Terminal-Bench 4.1 score from 5.6% to 12%, showing lightweight RL can more than double terminal task performance.