Views
No views yet
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)| Score Range | Grade |
|---|---|
| 90–100 | A |
| 80–89 | B |
| 70–79 | C |
| 60–69 | D |
| < 60 | F |
1pip install xgboost scikit-learn pandas joblib huggingface_hub
2import joblib
3import pandas as pd
4from huggingface_hub import hf_hub_download
5
6# Download model file from Hugging Face repo
7model_path = hf_hub_download(
8 repo_id="mjpsm/test-score-predictor",
9 filename="xgb_test_score_model.pkl"
10)
11
12# Load the model
13model = joblib.load(model_path)
14
15# Example student
16student = pd.DataFrame([{
17 "previous_test_score": 72,
18 "motivation_level": 8,
19 "self_confidence": 7,
20 "study_environment_quality": 6,
21 "time_management_skill": 5,
22 "last_minute_cram_hours": 3
23}])
24
25# Predict final score
26prediction = model.predict(student)[0]
27print(f"Predicted final test score: {prediction:.2f}")