Test Score Predictor (XGBoost)
This model predicts final test scores for students based on previous performance and study habits.
It was trained on a synthetic dataset of 1,000 rows generated to reflect average realism (balanced distribution of student profiles).
π Input Features
The model expects the following features:
previous_test_score β Studentβs most recent test score (0β100)
motivation_level β Self-reported motivation (1β10)
self_confidence β Confidence in academic ability (1β10)
study_environment_quality β Quality of study environment (1β10, quiet & focused = higher)
time_management_skill β Time management ability (1β10)
last_minute_cram_hours β Hours crammed the night before the test (0β12)
π― Output
- Predicted final test score (0β100)
- Can also be mapped to a letter grade (AβF)
| Score Range |
Grade |
| 90β100 |
A |
| 80β89 |
B |
| 70β79 |
C |
| 60β69 |
D |
| < 60 |
F |
π οΈ Usage
1. Install dependencies
pip install xgboost scikit-learn pandas joblib huggingface_hub
import joblib
import pandas as pd
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="mjpsm/test-score-predictor",
filename="xgb_test_score_model.pkl"
)
model = joblib.load(model_path)
student = pd.DataFrame([{
"previous_test_score": 72,
"motivation_level": 8,
"self_confidence": 7,
"study_environment_quality": 6,
"time_management_skill": 5,
"last_minute_cram_hours": 3
}])
prediction = model.predict(student)[0]
print(f"Predicted final test score: {prediction:.2f}")
π Training
- Algorithm: XGBoost Regressor
- Dataset: 1,000 rows synthetic (realistic student performance simulation)
Metrics on test set:
π Notes
- Predictions are continuous values, so results may slightly exceed 100 β clamp to [0, 100] if needed.
- The dataset reflects average realism: some students improve, some decline, depending on habits and prior scores.