Combine sparse and dense test for class_distribution