joseamuniz/mark

CorrelationDistance can return non-negative distances

Closed this issue · 1 comments

With gryffindor-sliderin.csv, add the following assertion to CorrelationDistance's apply method:

if (1.1 - abs(correlation(gradesList)) < 0 )
throw new RuntimeException("Computed negative distance") ;

The distance between Hagrid and Snape is negative due to a strong negative correlation of -1.53.

In method CorrelationDistance.apply loop through list versions of getStudents and getAssignments instead of sets to avoid duplicated grades from being removed.