There's a tendency to assume that the algorithm is complex & inscrutable, but it's actually very simple. There's no machine learning or AI here, just a crude adjustment that could have been done by hand if necessary.
if $pupil_sector == "state"
then $final_pupil_grade = adjust_func($pupil-grade)
else $final_pupil_grade = $pupil_grade
theguardian.com/commentisfree/…