def test_normalize_multi_factor(self): values_1 = np.random.rand(5) values_2 = np.random.rand(4, 3) values = np.array([values_1, values_2]) c = Categorical(values=values) c.normalize() self.assertTrue(c.is_normalized())
def test_normalize_two_dim(self): values = np.array([[1.0, 1.0], [1.0, 1.0]]) c = Categorical(values=values) expected_values = np.array([[0.5, 0.5], [0.5, 0.5]]) c.normalize() self.assertTrue(np.array_equal(c.values, expected_values))