Test sparse_class_distribution, Correct data indexing

Write a new test and update sparse_class_distribution for correctness,
the indexing of y.data in sparse_class_distribution is now done correctly