def test_get_normalizer_normalize_with_scaler(self): scaler = MinMaxScaler() scaler.fit(self.data) self.assertTrue( np.array_equal( Normalizer.normalize(self.data, fitted_scaler=scaler)[1], Normalizer.get_normalizer(Normalizer.NORMALIZE, data=self.data, fitted_scaler=scaler)[1])) self.assertTrue( Normalizer.normalize(self.data, fitted_scaler=scaler)[0], Normalizer.get_normalizer(Normalizer.NORMALIZE, data=self.data, fitted_scaler=scaler)[0])
def test_get_normalizer_standardize_with_scaler(self): scaler = StandardScaler() scaler.fit(self.data) self.assertTrue( np.array_equal( Normalizer.standardize(self.data, fitted_scaler=scaler)[1], Normalizer.get_normalizer(Normalizer.STANDARDIZE, data=self.data, fitted_scaler=scaler)[1])) self.assertTrue( Normalizer.standardize(self.data, fitted_scaler=scaler)[0], Normalizer.get_normalizer(Normalizer.STANDARDIZE, data=self.data, fitted_scaler=scaler)[0])
def test_get_normalizer_standardize(self): self.assertTrue( np.array_equal( Normalizer.standardize(self.data)[1], Normalizer.get_normalizer(Normalizer.STANDARDIZE, data=self.data)[1]))
def test_get_normalizer_max_norm(self): self.assertTrue( np.array_equal( Normalizer.max_norm(self.data), Normalizer.get_normalizer(Normalizer.MAX_NORM, data=self.data)))
def test_get_normalizer_l2_norm(self): self.assertTrue( np.array_equal( Normalizer.l2_norm(self.data), Normalizer.get_normalizer(Normalizer.L2_NORM, data=self.data)))
def test_get_normalizer_none(self): self.assertTrue( np.array_equal( Normalizer.none(self.data), Normalizer.get_normalizer(Normalizer.NONE, data=self.data)))
def test_get_normalizer_normalize(self): self.assertTrue( np.array_equal( Normalizer.normalize(self.data)[1], Normalizer.get_normalizer(Normalizer.NORMALIZE, data=self.data)[1]))