Code for the experiments. 
Also available from https://github.com/kaspar98/msc-knn-cal.