Code sample to implement nearest centroid classifier (along sklearn paradigm)