{"id":51141144,"url":"https://github.com/youngcoder45/student-performance-predictor","last_synced_at":"2026-07-02T05:00:53.078Z","repository":{"id":367310367,"uuid":"1280214757","full_name":"youngcoder45/Student-Performance-Predictor","owner":"youngcoder45","description":"An end-to-end Machine Learning project that predicts student academic performance using data preprocessing, feature engineering, model training, and a Streamlit-based interactive web application.","archived":false,"fork":false,"pushed_at":"2026-06-25T12:00:05.000Z","size":118,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-27T00:28:18.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youngcoder45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-25T11:24:55.000Z","updated_at":"2026-06-26T17:51:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/youngcoder45/Student-Performance-Predictor","commit_stats":null,"previous_names":["youngcoder45/student-performance-predictor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/youngcoder45/Student-Performance-Predictor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcoder45%2FStudent-Performance-Predictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcoder45%2FStudent-Performance-Predictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcoder45%2FStudent-Performance-Predictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcoder45%2FStudent-Performance-Predictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youngcoder45","download_url":"https://codeload.github.com/youngcoder45/Student-Performance-Predictor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcoder45%2FStudent-Performance-Predictor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34873663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-25T23:01:57.626Z","updated_at":"2026-06-28T01:00:42.573Z","avatar_url":"https://github.com/youngcoder45.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Student Performance Predictor\n\nProduction-style machine learning project for predicting student final exam scores and pass/fail outcomes.\n\n![Python](https://img.shields.io/badge/Python-3.12%2B-blue)\n![scikit-learn](https://img.shields.io/badge/ML-scikit--learn-orange)\n![Streamlit](https://img.shields.io/badge/App-Streamlit-red)\n![License](https://img.shields.io/badge/License-MIT-green)\n\n\u003c/div\u003e\n\n## Project Overview\n\nStudent Performance Predictor is an end-to-end machine learning application that solves two related academic analytics problems:\n\n- Regression: predict a student's final exam score from academic, behavioral, and demographic inputs.\n- Classification: predict whether the student is likely to pass or fail.\n\nThe project is structured as a portfolio-ready ML system, not a single notebook. It includes data ingestion, cleaning, EDA, feature engineering, model comparison, hyperparameter tuning, model persistence, and an interactive Streamlit application.\n\n## Features\n\n- UCI Student Performance dataset integration with a deterministic offline fallback dataset.\n- Data quality handling for missing values, duplicates, invalid values, categorical encoding, and scaling.\n- Engineered academic features such as study efficiency, homework ratio, engagement score, sleep quality index, grade trend, and risk index.\n- Regression models: Linear Regression, Decision Tree, Random Forest, Gradient Boosting, and optional XGBoost.\n- Classification models: Logistic Regression, Decision Tree, Random Forest, SVM, Gradient Boosting, and optional XGBoost.\n- Hyperparameter tuning with `RandomizedSearchCV`.\n- Saved `joblib` artifacts for regression, classification, preprocessing, encoder, and scaler.\n- Streamlit interface with score prediction, pass/fail probability, confidence score, and feature contribution chart.\n- Reproducible notebooks for EDA and model training.\n\n## Screenshots\n\nAdd screenshots after running the Streamlit app:\n\n- `screenshots/app_home.png`\n- `screenshots/prediction_result.png`\n- `reports/figures/regression_feature_importance.png`\n- `reports/figures/classification_feature_importance.png`\n- `reports/figures/confusion_matrix.png`\n- `reports/figures/roc_curve.png`\n\n## Dataset\n\nPrimary source: UCI Machine Learning Repository, Student Performance Datasets.\n\nThe training code attempts to download:\n\n```text\nhttps://archive.ics.uci.edu/ml/machine-learning-databases/00320/student.zip\n```\n\nThe UCI data contains Portuguese school performance records. This project standardizes the source fields into a clean portfolio schema:\n\n- `gender`\n- `age`\n- `study_hours`\n- `attendance`\n- `sleep_hours`\n- `previous_grade`\n- `internet_access`\n- `parent_education`\n- `family_income`\n- `extra_classes`\n- `assignments_completed`\n- `participation`\n- `final_score`\n- `pass_fail`\n\nIf the dataset cannot be downloaded, `src/utils.py` creates a deterministic synthetic dataset so the project still trains and runs offline.\n\n## Installation\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install --upgrade pip\npip install -r requirements.txt\n```\n\n## Project Structure\n\n```text\nstudent-performance-predictor/\n├── data/\n│   ├── raw/\n│   └── processed/\n├── notebooks/\n│   ├── EDA.ipynb\n│   └── Model_Training.ipynb\n├── models/\n│   ├── regression.pkl\n│   ├── classifier.pkl\n│   ├── preprocessor.pkl\n│   ├── encoders_scaler.pkl\n│   └── metrics.json\n├── reports/\n│   └── figures/\n├── screenshots/\n├── src/\n│   ├── preprocessing.py\n│   ├── feature_engineering.py\n│   ├── train.py\n│   ├── predict.py\n│   └── utils.py\n├── app.py\n├── requirements.txt\n├── pyproject.toml\n├── README.md\n├── LICENSE\n└── .gitignore\n```\n\n## Machine Learning Workflow\n\n1. Load UCI data or create the offline fallback dataset.\n2. Standardize source columns into a consistent application schema.\n3. Remove duplicates and correct invalid numeric ranges.\n4. Create engineered features:\n   - Study Efficiency = Study Hours x Attendance\n   - Homework Ratio\n   - Academic Engagement Score\n   - Sleep Quality Index\n   - Grade Trend\n   - Risk Index\n5. Split data into train and test sets.\n6. Build sklearn pipelines with median imputation, categorical imputation, standard scaling, and one-hot encoding.\n7. Train multiple regression and classification models.\n8. Tune final Random Forest models with `RandomizedSearchCV`.\n9. Evaluate with regression and classification metrics.\n10. Save models, preprocessing artifacts, metrics, and diagnostic plots.\n11. Serve predictions through Streamlit.\n\n## Exploratory Data Analysis\n\nThe EDA notebook includes:\n\n- Missing-value audit\n- Duplicate-record check\n- Summary statistics\n- IQR outlier detection\n- Histograms\n- Box plots\n- Final-score distribution\n- Pass/fail distribution\n- Correlation heatmap\n- Pair plot\n- Categorical distributions\n- Feature importance preview\n\nEach graph is followed by an interpretation explaining what the visualization contributes to model design.\n\n## Algorithms Used\n\nRegression:\n\n- Linear Regression\n- Decision Tree Regressor\n- Random Forest Regressor\n- Gradient Boosting Regressor\n- XGBoost Regressor, when installed\n\nClassification:\n\n- Logistic Regression\n- Decision Tree Classifier\n- Random Forest Classifier\n- Support Vector Machine\n- Gradient Boosting Classifier\n- XGBoost Classifier, when installed\n\n## Evaluation Metrics\n\nRegression:\n\n- MAE\n- MSE\n- RMSE\n- R2 Score\n\nClassification:\n\n- Accuracy\n- Precision\n- Recall\n- F1 Score\n- ROC Curve\n- Confusion Matrix\n\n## Run Training\n\n```bash\npython -m src.train\n```\n\nGenerated artifacts:\n\n- `models/regression.pkl`\n- `models/classifier.pkl`\n- `models/preprocessor.pkl`\n- `models/encoders_scaler.pkl`\n- `models/metrics.json`\n- `reports/figures/regression_model_comparison.csv`\n- `reports/figures/classification_model_comparison.csv`\n- `reports/figures/regression_feature_importance.png`\n- `reports/figures/classification_feature_importance.png`\n- `reports/figures/confusion_matrix.png`\n- `reports/figures/roc_curve.png`\n\n## Run the Web App\n\n```bash\nstreamlit run app.py\n```\n\nThe app sidebar accepts student details and returns:\n\n- Predicted final score\n- Pass/fail result\n- Pass probability\n- Confidence score\n- Feature contribution chart\n\n## Results\n\nThe latest training run used the UCI Student Performance dataset and selected the best evaluated candidate from the baseline and tuned model set.\n\nSelected regression model: Random Forest Regressor\n\n| Metric | Value |\n| --- | ---: |\n| MAE | 5.4359 |\n| MSE | 61.7454 |\n| RMSE | 7.8578 |\n| R2 | 0.8801 |\n\nSelected classification model: Gradient Boosting Classifier\n\n| Metric | Value |\n| --- | ---: |\n| Accuracy | 0.9494 |\n| Precision | 0.9552 |\n| Recall | 0.9846 |\n| F1 Score | 0.9697 |\n\nThe final metrics are saved to `models/metrics.json`, and comparison tables are saved under `reports/figures/`.\n\nThe expected strong predictors are previous grades, attendance, study efficiency, assignments completed, engagement score, and risk index.\n\n## Future Improvements\n\n- Add model monitoring for prediction drift.\n- Add SHAP explanations for richer local interpretability.\n- Add a REST API with FastAPI.\n- Add automated CI checks for formatting and training smoke tests.\n- Expand the dataset with school-specific and semester-specific records.\n- Add threshold optimization for pass/fail decisions.\n\n## License\n\nThis project is licensed under the MIT License. See `LICENSE` for details.\n\n## Author\n\nAditya Verma\n\nPortfolio project for GitHub, LinkedIn, and internship applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungcoder45%2Fstudent-performance-predictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoungcoder45%2Fstudent-performance-predictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungcoder45%2Fstudent-performance-predictor/lists"}