Predict student math scores from demographic and academic inputs using a trained model and a simple Flask web UI.
- A Flask app that serves a prediction form and result page.
- A trained model and preprocessor in
artifacts/used for inference. - Modular pipeline code in
src/for data processing and prediction. - Notebooks for EDA and model training in
notebook/.
application.py- Flask app entry point (default port 5000).app.py- Flask app entry point with debug on port 8000.templates/- HTML templates for the UI.src/- Pipeline, components, utilities, and exception handling.artifacts/- Model, preprocessor, and sample datasets.notebook/- EDA and training notebooks.
- Create and activate a virtual environment (optional).
- Install dependencies:
pip install -r requirements.txt
- Run the web app:
Then open
python application.py
http://localhost:5000in your browser.
If you prefer debug mode and port 8000:
python app.pyThe app expects the following fields:
- Gender
- Race or ethnicity
- Parental level of education
- Lunch type
- Test preparation course
- Reading score (0-100)
- Writing score (0-100)
- Prediction uses
artifacts/model.pklandartifacts/preprocessor.pklviasrc/pipeline/predict_pipeline.py. - If you retrain or replace artifacts, keep the filenames the same or update the pipeline accordingly.
The notebooks in notebook/ cover exploratory data analysis and model training. They can be used to reproduce or refine the model.
https://github.com/JavierPachas/e2eproject/blob/main/img/home.png