Project 2 of 10, for Paul
Exam Score Model
Predict a student's final maths grade from what's known after the first term: five columns scaled, five weights learnt by gradient descent, then a curve for absences chosen on validation and tested once, honestly, on 357 real students.
Sign up free to open itLog in
Act 6 needs a free account, so your work is saved as you go. Act 1 is open to everyone.
The brief
- PaulI mark your tests, and I'd like to know by Christmas who needs a hand, before the marks tell me.
- PaulDon't worry, not on you lot. We'll use 357 real students from two schools in Portugal, and it's all public.
- RiyaI've already done one, actually, and it's perfect on every student I gave it.
- PaulPerfect on the ones you gave it, okay, but what about the rest?
students.csv holds 357 real maths students from two schools in Portugal: their first-term grade, weekly study time (1 to 4), past failures, how often they go out (1 to 5) and absences, and their final grade, all grades out of 20.
In exam_scores.py, guess the final grade from those five columns:
- Put the five columns on the same scale, learn one weight for each by walking downhill, and check the weights against the exact answer.
- Lock a fifth of the students away for testing. Split the rest into students to learn from and students to choose with.
- Ask whether absences need a curve: try absences up to the power 8, score each on the students you choose with, and pick one.
- Open the locked-away students once, and compare with guessing the average. Then guess for a new student.
Learning from 214 students, choosing with 72, testing with 71
first_term +2.71
study_time -0.11
failures -0.02
going_out -0.08
absences -0.32
Least squares agrees: True
degree training validation
1 2.124 1.973
2 2.119 1.947
3 2.118 1.958
4 2.117 1.970
5 2.117 1.969
6 2.093 2.663
7 2.066 5.016
8 2.036 32.619
Chosen degree: 2
Test error: 1.29 marks
Guessing the average: 3.32 marks
A new student, 12 after the first term: about 12.2 out of 20What you learn
What's in it
- One dial per column
- Two students, two weights
- Every column the same size
- Next Saturday, scaled
- Every slope at once
- The exact answer, for checking
- No column of ones
- How Paul would scale it
- Fix Riya's version
- Five columns, five weights
- Lock some away
- A fifth for testing
- Curves from extra columns
- Learning by heart
- By heart
- A third pile, for choosing
- Reading a validation curve
- Tested honestly
- Ship it