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
# Download model file from Hugging Face repo
model_path = hf_hub_download(
repo_id="mjpsm/test-score-predictor",
filename="xgb_test_score_model.pkl"
)
# Load the model
model = joblib.load(model_path)
# Example student
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
}])
# Predict final score
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:
- MSE: ~38.25
- RΒ²: ~0.79
π 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.
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support
Evaluation results
- mean_squared_error on Synthetic Test Score Datasetself-reported38.250
- r2 on Synthetic Test Score Datasetself-reported0.790