How sania1006/student_pass_fail_prediction works
Purpose and entry points
This repository predicts whether a student will pass or fail from student-record features. It contains both model-training and saved-model inference paths, plus a lightweight HTML-serving application.
Primary entry points:
• train.py — trains and persists the classifier.
• predict.py / use_saved_model.py — load pass_fail_model.pkl for inference.
• app.py — application-facing entry point, likely serving templates/index.html.
• student_pass_fail_prediction.py — standalone prediction workflow or earlier integrated implementation.
Training data and model artifact
students.csv is the source dataset for supervised training. train.py is the main boundary between raw tabular data and a reusable model artifact:
• Reads students.csv.
• Prepares features and pass/fail labels.
• Fits the model.
• Writes pass_fail_model.pkl.
The persisted pickle is the contract between training and all inference consumers. Feature names, ordering, encodings, and preprocessing must remain compatible with the training logic.
Paths: students.csv, train.py, pass_fail_model.pkl.
Inference layer
Saved-model inference is separated from training:
• predict.py provides prediction behavior against pass_fail_model.pkl.
• use_saved_model.py is an additional direct consumer of the serialized model.
• student_pass_fail_prediction.py may provide an alternative end-to-end or command-line workflow.
These scripts should be treated as clients of the model-artifact contract rather than places to retrain models.
Paths: predict.py, use_saved_model.py, pass_fail_model.pkl.
Application and presentation boundary
app.py connects user-facing request handling to model prediction. The only declared presentation asset is:
• templates/index.html — form/page used to collect student inputs and display a result.
The application layer should validate and normalize submitted values before passing them to inference, then translate the model output into a pass/fail response. It should not own training or mutate the model artifact during requests.
Paths: app.py, templates/index.html, pass_fail_model.pkl.
Primary control flow
1. Training workflow loads students.csv.
2. train.py transforms training inputs and writes pass_fail_model.pkl.
3. A prediction client (app.py, predict.py, or use_saved_model.py) loads the artifact.
4. Client-provided student features are transformed into the model’s expected feature vector.
5. The classifier returns a pass/fail prediction.
6. app.py renders the result through templates/index.html; script clients output it directly.
Runtime and dependencies
The repository is Python-based, with dependencies defined in requirements.txt. Model serialization uses a local pickle artifact rather than a remote model registry or external inference service. No database, cloud infrastructure, queue, or external API is represented in the supplied tree.
Paths: requirements.txt, pass_fail_model.pkl, app.py.
Main entry points: pass_fail_model.pkl Saved classifier · app.py Application server · train.py Model training · predict.py Prediction script
Components 11
Training pipeline
- Student records · Supervised training source.
students.csv - Model training
train.py - Feature preparation · Produces compatible features and pass/fail labels.
Saved-model inference
- Prediction script
predict.py - Direct model client
use_saved_model.py - Standalone workflow
student_pass_fail_prediction.py - Feature-to-prediction · Transforms student inputs into the model feature vector and returns pass/fail.
Web application
- Application server · Validates submitted values and serves prediction results.
app.py - Student input form
templates/index.html
Other components
- Saved classifier · Shared contract for feature ordering, encodings, and preprocessing.
pass_fail_model.pkl - Python dependencies
requirements.txt
Connections 15
- Student records → Model training: loads
- Model training → Feature preparation: prepares
- Feature preparation → Saved classifier: fits and persists
- Prediction script → Saved classifier: loads
- Direct model client → Saved classifier: loads
- Standalone workflow → Saved classifier: uses for inference
- Prediction script → Feature-to-prediction: provides inputs
- Direct model client → Feature-to-prediction: provides inputs
- Feature-to-prediction → Saved classifier: predicts with
- Application server → Feature-to-prediction: normalizes inputs
- Application server → Saved classifier: loads
- Student input form → Application server: submits student inputs
- Application server → Student input form: renders result
- Python dependencies → Model training: runtime dependencies
- Python dependencies → Application server: runtime dependencies