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.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results