Downloads · 30 days
0
leangchheng27/cambodia-major-field-recommender
cambodia-major-field-recommender is a machine learning model from leangchheng27. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A machine learning-powered recommendation system that suggests university major fields to Cambodian high school students based on their academic grades.
Downloads · 30 days
0
Access
Public
Updated Mar 29, 2026
Repo size
22 MB
Likes
0
Public
Click a slice to open those files.
.pkl10.8 MB · 100%
From the Hugging Face model README
A machine learning-powered recommendation system that suggests university major fields to Cambodian high school students based on their academic grades.
# Activate virtual environment
source bin/activate
# Run web server
python app.py
# Visit http://localhost:5000
See PRODUCTION_GUIDE.md for detailed deployment instructions.
ai-env/
├── app.py # Flask web server
├── train_mac.py # Model training script
├── evaluate_accuracy.py # Model evaluation
├── requirements.txt # Python dependencies
├── .env.example # Environment template
├── templates/
│ └── index.html # Web interface
├── data/
│ ├── combined_train.csv # Training data
│ └── combined_test.csv # Test data
├── results/
│ └── combined/
│ ├── lightgbm_multioutput.pkl # Trained model
│ └── metadata.pkl # Model metadata
├── MODEL_REPORT.md # Detailed model documentation
└── PRODUCTION_GUIDE.md # Deployment instructions
✅ Multi-stream Support: Separate subject requirements for Science and Social streams
✅ LightGBM ML Model: Fast, accurate predictions with 79.72% Top-5 accuracy
✅ Web Interface: User-friendly form for grade input and recommendations
✅ REST API: /api/predict endpoint for integration
✅ Production Ready: Configured for Gunicorn, Docker, and cloud deployment
| Metric | Score |
|---|---|
| Top-1 Accuracy | 29.75% |
| Top-3 Accuracy | 62.59% |
| Top-5 Accuracy | 79.72% |
| Prediction Latency | ~50ms |
See MODEL_REPORT.md for full technical details.
curl -X POST http://localhost:5000/api/predict \
-H "Content-Type: application/json" \
-d '{
"stream": "science",
"grades": {
"mathematics": "A",
"khmer": "B",
"english": "A",
"history": "C",
"biology": "B",
"chemistry": "A",
"physics": "B"
}
}'
# Prepare data in data/combined_train.csv and data/combined_test.csv
python train_mac.py
# Evaluate model
python evaluate_accuracy.py
⭐ = Required in both streams
The model predicts probability scores for these 12 fields:
Install all with: pip install -r requirements.txt
Copy .env.example to .env and customize:
cp .env.example .env
# Edit .env with your settings
FLASK_DEBUG: Enable debug mode (false for production)HOST: Server host (default: 127.0.0.1)PORT: Server port (default: 5000)MODEL_PATH: Path to trained modelMETADATA_PATH: Path to model metadatapython app.py
gunicorn --workers 4 --bind 0.0.0.0:5000 app:app
docker build -t major-recommender .
docker run -p 5000:5000 major-recommender
See PRODUCTION_GUIDE.md for more deployment options.
High school grade data with columns:
mathematics, khmer, english, history: All studentsbiology, chemistry, physics: Science stream onlygeography, moral_civics, earth_science: Social stream onlystream: "science" or "social"{
"stream": "Science",
"majors": [
{"field": "Engineering", "score": 0.145},
{"field": "IT & Computer Science", "score": 0.128},
...
]
}
tail -f logs/app.log/api/predict regularlyresults/combined/chmod 644 results/combined/*export PORT=5001 && python app.pylsof -i :5000 then kill -9 <PID>python app.py (development mode)Educational/Research Project - CADT Capstone 2026
Developed as part of CADT Year 3, Term 2 Capstone Project
Version: 1.0
Last Updated: March 2026
Status: Production Ready ✅