return sample_weights # ============================================================================= # Initialization # ============================================================================= # Values that the "normalize" parameter can take to # parametrize the testing method of kendall_distance NORMALIZE = [True, False] # Initialize a random number generator to # ensure that the tests are reproducible seed = 198075 random_state = check_random_state(seed) n_repetitions = 2 n_samples = 20 n_classes = 5 Y_true = _make_label_ranking(n_samples, n_classes, random_state) Y_pred = _make_label_ranking(n_samples, n_classes, random_state) sample_weights = _make_sample_weights(n_repetitions, n_samples, random_state) # ============================================================================= # Testing # ============================================================================= @pytest.mark.parametrize("normalize", NORMALIZE)
def setup(self): """Setup the attributes for testing.""" self.random_state = check_random_state(198075) self.X1 = self.random_state.random_sample((2, 2)) self.X2 = self.random_state.random_sample((5, 2))