def test_fit_transform_pf(self):
     """Checks that in the case of normalization by columns,
     the result is the same as in the case of using the package from sklearn
     """
     X = np.random.uniform(0, 100, size=(3, 3))
     model = StandardFlexibleScaler(column_wise=True)
     transformed_skcosmo = model.fit_transform(X)
     transformed_sklearn = StandardScaler().fit_transform(X)
     self.assertTrue((np.isclose(transformed_sklearn,
                                 transformed_skcosmo,
                                 atol=1e-12)).all())
 def test_fit_transform_npf(self):
     """Checks that the entire matrix is correctly normalized
     (not column-wise). Compare with the value calculated
     directly from the equation.
     """
     X = np.random.uniform(0, 100, size=(3, 3))
     model = StandardFlexibleScaler(column_wise=False)
     X_tr = model.fit_transform(X)
     mean = X.mean(axis=0)
     var = ((X - mean)**2).mean(axis=0)
     scale = np.sqrt(var.sum())
     X_ex = (X - mean) / scale
     self.assertTrue((np.isclose(X_ex, X_tr, atol=1e-12)).all())