예제 #1
0
 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])
예제 #2
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])
예제 #3
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]))
예제 #4
0
 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)))
예제 #5
0
 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)))
예제 #6
0
 def test_get_normalizer_none(self):
     self.assertTrue(
         np.array_equal(
             Normalizer.none(self.data),
             Normalizer.get_normalizer(Normalizer.NONE, data=self.data)))
예제 #7
0
 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]))