Group 2 — Team 07 | CADT IDT · Second Year · OOP (Python)
Lecturer: Han Leangsiv | Seat Sreylenn · Chhim SokSambath · Yin Sousdey
Academic Year 2024–2025
The Student Habits & Performance Analytics System is a Python-based desktop application that analyzes student behavioral data and predicts exam performance using Machine Learning. It is built with Object-Oriented Programming principles and presented through a modern dark-themed CustomTkinter GUI no command-line interaction required.
The system loads data from a real-world dataset of 1,000 students (sampled from 80,000) containing 30+ behavioral, health, socio-economic, and academic attributes per student. A Random Forest Regressor (scikit-learn) is trained on 24 behavioral features to predict each student's exam_score (0–100).
- Analytics — View all students, top performers, at-risk students, dropout-risk flags, score distribution charts, semester averages, and major rankings
- Prediction — Predict a student's exam score by entering a manual behavioral profile or by looking up an existing student ID
- OOP Architecture — Implements Encapsulation, Inheritance, Polymorphism, Abstraction, and 5 Magic Methods across the
Student,UndergraduateStudent, andGraduateStudentclass hierarchy - Dual Data Source — Supports both CSV file loading and MySQL database connection
- Report Export — Generates and saves individual student
.txtreports todata/reports/
# If using Git
git clone https://github.com/sslenn/Cadtalytics
cd Cadtalytics
# If using the ZIP file
# Extract the ZIP, then navigate into the proj2_out/ folderpip install -r requirements.txtpython main.pyThe app will:
- Automatically load
data/students_habits.csv - Build all student objects
- Train the Random Forest model in the background (~2–5 seconds)
- Display the GUI with all 13 views ready to use
Note: The Prediction views will show a loading message until the RF model finishes training. All Analytics views are available immediately.
If you have MySQL running, first import the database:
mysql -u root -p < students_1000.sqlThen when the app starts, select option 2 (Load from MySQL database). Update the connection settings in main.py if needed:
FileHandlerMySQL(
host="127.0.0.1",
port=8889,
user="root",
password="root",
database=students_1000"
)| Library | Version | Purpose |
|---|---|---|
customtkinter |
>= 5.2.0 | Modern dark-themed GUI framework |
matplotlib |
>= 3.7.0 | Embedded charts and visualizations |
numpy |
>= 1.24.0 | Array operations for ML |
scikit-learn |
>= 1.3.0 | RandomForestRegressor, train_test_split, R², MAE |
mysql-connector-python |
>= 8.0.0 | Optional MySQL data source |
All dependencies can be installed with a single command:
pip install customtkinter matplotlib numpy scikit-learn mysql-connector-pythonOr using the provided requirements file:
pip install -r requirement.txt- Python 3.10 or higher is required
- Check your version:
python --version - Download from: https://www.python.org/downloads/
Compatible with Windows, macOS, and Linux.
https://github.com/sslenn/Cadtalytics
Cadtalytics/
│
├── main.py # GUI entry point
├── requirement.txt # Python dependencies
├── README.md # This file
│
├── data/
│ ├── students_habits.csv # 1,000-student dataset
│ └── reports/ # Exported .txt and .png reports
│
└── src/
├── student.py # Base Student class
├── student_types.py # UndergraduateStudent & GraduateStudent
├── grade_manager.py # Manages Student objects
├── analytics.py # Statistical analysis
├── visualizer.py # Chart generation
├── predictor.py # Random Forest model
├── file_handler.py # CSV read/write/export
└── file_handler_mysql.py # MySQL connection
Cambodia Academy of Digital Technology (CADT) — OOP (Python) Final Project