def test_should_return_50p_for_classes_with_same_frequencies(self): assert calculate_median_weights_for_frequencies([[3, 3, 3], [3, 3, 3]]) == [0.5, 0.5]
def test_should_return_zero_value_for_not_occuring_class(self): frequencies = [[1, 1], [1, 1], [0, 0]] result = calculate_median_weights_for_frequencies(frequencies) get_logger().debug('result: %s', result) assert_close(sum(result), 1.0) assert_all_close(result, [0.5, 0.5, 0.0], atol=0.001)
def test_should_return_one_for_single_class(self): assert calculate_median_weights_for_frequencies([[3, 3, 3]]) == [1.0]