EarlyDrop estimates student dropout risk from enrollment-time information, helping teams prioritize timely, human-led outreach before semester performance is available.
Responsible-use note: EarlyDrop is a portfolio demonstration and decision-support tool. It produces a screening signal, not an automated academic decision. Every flagged profile requires contextual human review.
EarlyDrop is an end-to-end supervised machine learning application for early student dropout-risk assessment. It uses ten enrollment and background factors to estimate the probability that a student belongs to the dropout class, then compares that probability with a model-specific review threshold.
The project is deliberately scoped to an early-intervention setting. Semester grades, curricular-unit outcomes, tuition-payment status, debtor status, and scholarship status are excluded because they are either unavailable at enrollment or could introduce post-enrollment leakage. The result is a compact Streamlit product that demonstrates the full workflow from exploratory analysis and preprocessing to saved pipelines, model evaluation, and interactive inference.
This is a tabular classification project, not an NLP project. The data is structured student-record data, and the core task is binary classification between Graduate and Dropout outcomes.
The assessment form groups inputs into student profile, academic background, family education, and access-and-support sections. User-facing labels remain readable while the application preserves the encoded values expected by the saved pipeline.
The result view communicates a review-oriented risk state, estimated dropout and graduation probabilities, the active model, and the configured review threshold.
- Early-stage assessment: Collects ten practical inputs that can be available at or near enrollment.
- Readable input design: Translates encoded source categories into clear English labels without changing the model input contract.
- Model selection: Exposes the five trained candidate pipelines while presenting Random Forest as the recommended model.
- Threshold-aware decisions: Applies the threshold saved for the selected model instead of assuming the default 0.50 cutoff.
- Review-oriented output: Frames predictions as
Elevated risk, review recommendedorLower risk, routine support, not deterministic student outcomes. - Transparent performance view: Presents benchmark metrics, feature importance, threshold trade-offs, and test-set evaluation visuals.
- Defensive artifact checks: Stops the app if the feature configuration and saved-model metadata disagree.
flowchart LR
A["Student profile inputs"] --> B["Readable labels and encoded values"]
B --> C["Saved scikit-learn pipeline"]
C --> D["Feature-specific preprocessing"]
D --> E["Selected classification model"]
E --> F["Dropout probability"]
F --> G["Model-specific review threshold"]
G --> H["Human-review risk signal"]
The application loads the saved pipelines, model metadata, input configuration, and processed dataset at startup. A submitted profile becomes a one-row dataframe in the expected feature order. The selected pipeline transforms the raw values and returns class probabilities. EarlyDrop compares the dropout probability with the threshold stored for that model and renders a review-oriented result.
The original UCI dataset contains Graduate, Dropout, and Enrolled targets. The project removes Enrolled records and models the resulting binary task:
Graduate = 0Dropout = 1
Dropout is treated as the positive class because the product goal is to surface potentially at-risk profiles early enough for supportive intervention.
The deployed MVP has a fixed ten-feature contract:
- Marital status
- Study program
- Previous qualification
- Mother's education level
- Father's education level
- Displaced-student status
- Educational special-needs status
- Gender
- Age at enrollment
- International-student status
The same feature list is recorded in the saved model metadata, application configuration, processed dataset, and automated tests. This protects against a common deployment failure where the application sends a model an unexpected set or order of features.
The model uses a ColumnTransformer inside each saved scikit-learn pipeline, so training and inference share the same transformations.
| Feature group | Transformation | Rationale |
|---|---|---|
Displaced, Educational special needs, Gender, International |
Passthrough | These fields are already binary encoded. |
Age at enrollment |
RobustScaler |
Handles the right-skewed distribution and is less sensitive to higher-age outliers. |
Marital status, Course, Previous qualification |
OneHotEncoder(drop="first") |
Treats category codes as nominal values, not ordered quantities. |
| Mother's and father's qualification | Cross-fitted TargetEncoder(cv=5) |
Keeps high-cardinality parental-education features compact while reducing target-leakage risk during training. |
Five classical classification pipelines are evaluated with five-fold stratified cross-validation:
- Logistic Regression
- Random Forest
- Gradient Boosting
- Extra Trees
- SVM with an RBF kernel
Random Forest is selected as the recommended model because it has the strongest dropout F1 score in the reported cross-validation comparison while maintaining competitive recall and ROC-AUC. The final Random Forest threshold is set to 0.40, rather than the conventional 0.50, to prioritize recall in an early-warning workflow.
Lowering the threshold increases the chance of flagging an at-risk student, but it also increases the number of profiles that need human review. The interface makes this trade-off explicit instead of presenting the output as a final decision.
| Model | Recall | Precision | F1 score | ROC-AUC |
|---|---|---|---|---|
| Random Forest | 0.684 | 0.614 | 0.647 | 0.770 |
| Extra Trees | 0.690 | 0.599 | 0.641 | 0.764 |
| SVM (RBF) | 0.683 | 0.598 | 0.638 | 0.762 |
| Logistic Regression | 0.666 | 0.610 | 0.637 | 0.759 |
| Gradient Boosting | 0.562 | 0.665 | 0.609 | 0.766 |
| Metric | Result |
|---|---|
| Decision threshold | 0.40 |
| Accuracy | 0.654 |
| Precision | 0.537 |
| Dropout recall | 0.838 |
| F1 score | 0.655 |
| ROC-AUC | 0.775 |
The final threshold identifies approximately 83.8% of dropout cases in the held-out evaluation. That recall-focused operating point produces lower precision, so it is suitable only when alerts are reviewed by people who can assess the student's wider context.
| Area | Tools |
|---|---|
| Interface | Streamlit 1.55 |
| Application logic | Python 3.11, joblib |
| Data handling | pandas 2.3, NumPy 2.3 |
| Modeling | scikit-learn 1.8 |
| Reporting | Matplotlib, Seaborn |
| Testing | Python unittest, scikit-learn pipeline inference checks |
student-dropout-prediction-ml/
|-- .streamlit/
| `-- config.toml # Streamlit theme and runtime settings
|-- app/
| |-- app.py # Streamlit interface and inference flow
| `-- feature_config.json # Readable labels, mappings, and input settings
|-- assets/
| |-- earlydrop-logo.svg # Brand asset
| `-- screenshots/ # Verified application screenshots
|-- data/
| |-- raw/dataset.csv # Source dataset copy
| `-- processed/ # Prepared model inputs and readable variants
|-- docs/ # Scope, methodology, and project rationale
|-- models/ # Serialized pipelines and model metadata
|-- notebooks/
| |-- 01_eda.ipynb
| |-- 02_preprocessing.ipynb
| `-- 03_model_training_and_feature_selection.ipynb
|-- reports/
| |-- figures/ # Evaluation charts and confusion matrices
| `-- *.csv # Model and threshold results
|-- tests/test_model_artifacts.py # Artifact-contract and inference checks
|-- requirements.txt
|-- requirements-dev.txt
`-- README.md
Python 3.11 is recommended because the serialized artifacts were created with the pinned NumPy and scikit-learn versions in requirements.txt.
git clone https://github.com/LecyLecy/student-dropout-prediction-ml.git
cd student-dropout-prediction-ml
python -m venv .venvActivate the environment:
# Windows PowerShell
.venv\Scripts\Activate.ps1
# macOS or Linux
source .venv/bin/activateInstall dependencies and run the application:
python -m pip install -r requirements.txt
python -m streamlit run app/app.pyOpen http://localhost:8501 when Streamlit finishes starting.
Install the notebook-development dependencies:
python -m pip install -r requirements-dev.txtRun the notebooks in this order:
notebooks/01_eda.ipynbnotebooks/02_preprocessing.ipynbnotebooks/03_model_training_and_feature_selection.ipynb
The training notebook writes the serialized pipelines, metadata, result tables, and report figures used by the Streamlit application.
The repository includes artifact-level automated tests in tests/test_model_artifacts.py. They verify that:
- the feature contract matches across application configuration, model metadata, and processed data;
- every declared model is available in the saved pipeline collection;
- every pipeline produces a finite, valid two-class probability distribution for a real data row.
Run the test suite with:
python -m unittest discover -s tests -v- The data represents one higher-education context, so reported performance should not be assumed to transfer to another institution or country.
- The application supports early screening, not causal explanation or individual outcome certainty.
- The recall-first threshold trades precision for sensitivity, which can create additional review workload.
- Demographic and family-background features require local fairness, privacy, and governance review before operational use.
- The project ships pretrained artifacts rather than a scheduled retraining or production monitoring workflow.
- Validate the pipeline on recent, institution-specific data and recalibrate probabilities.
- Audit error rates and calibration across relevant student groups before any operational deployment.
- Add controlled access, audit logging, and a documented reviewer workflow.
- Replace manually supplied context variables with institution-approved data integrations where appropriate.
- Add drift monitoring and a reproducible retraining process for updated datasets.
This project uses the Predict Students' Dropout and Academic Success dataset from the UCI Machine Learning Repository.
Realinho, V., Machado, J., Baptista, J., and Martins, M. V. (2022). Predict Students' Dropout and Academic Success [Data set]. UCI Machine Learning Repository. https://doi.org/10.24432/C5MC89
No license file is currently included in this repository. Confirm the dataset terms and add a project license before redistributing or extending the work.



