How mohsin-02/mlproject works
This is a student exam-score regression project with two connected workflows: dataset exploration and model training, followed by a Flask form that turns student inputs into a predicted maths score. The documented training stages are ingestion and splitting, preprocessing, model comparison and selection, and artifact persistence; serving builds a feature row, applies saved preprocessing, and predicts. The sampled code supports the training calls from data_ingestion.py’s script entry point and the web prediction flow. The README also describes notebook model comparison; notebook internals were not sampled. Note that transformation saves proprocessor.pkl, while prediction loads preprocessor.pkl, so those paths appear inconsistent.
Main entry points: utils.py Artifact serialization · app.py Flask routes · predict_pipeline.py Prediction pipeline · stud.csv Student dataset
Components 17
Exploration and training
- Student dataset
notebook/data/stud.csv - Data exploration
notebook/1 . EDA STUDENT PERFORMANCE .ipynb - Notebook training
notebook/2. MODEL TRAINING.ipynb - Ingest and split
src/components/data_ingestion.py - Preprocess data
src/components/data_transformation.py - Train and select
src/components/model_trainer.py
Web prediction
- Flask routes
app.py - Landing page
templates/index.html - Prediction form
templates/home.html - Feature row
src/pipeline/predict_pipeline.py - Prediction pipeline
src/pipeline/predict_pipeline.py
Shared runtime
- Model evaluation
src/utils.py - Artifact serialization
src/utils.py - Saved artifacts
artifacts - Saved preprocessor
artifacts/preprocessor.pkl - Saved model
artifacts/model.pkl
Other components
- Student
Connections 21
- Student dataset → Data exploration: explores
- Student dataset → Notebook training: trains from
- Student dataset → Ingest and split: reads
- Ingest and split → Preprocess data: calls
- Preprocess data → Train and select: returns arrays
- Train and select → Model evaluation: evaluates models
- Train and select → Artifact serialization: saves model
- Preprocess data → Artifact serialization: saves preprocessor
- Artifact serialization → Saved artifacts: writes
- Student → Flask routes: opens
- Flask routes → Landing page: renders
- Flask routes → Prediction form: renders
- Student → Prediction form: submits inputs
- Flask routes → Feature row: builds features
- Feature row → Prediction pipeline: provides dataframe
- Prediction pipeline → Artifact serialization: loads artifacts via
- Artifact serialization → Saved preprocessor: reads
- Artifact serialization → Saved model: reads
- Prediction pipeline → Saved preprocessor: transforms features
- Prediction pipeline → Saved model: predicts with
- Flask routes → Prediction form: renders result