def test__repr__(): assert cuStandardScaler().__repr__() == 'StandardScaler()' assert cuMinMaxScaler().__repr__() == 'MinMaxScaler()' assert cuMaxAbsScaler().__repr__() == 'MaxAbsScaler()' assert cuNormalizer().__repr__() == 'Normalizer()' assert cuBinarizer().__repr__() == 'Binarizer()' assert cuPolynomialFeatures().__repr__() == 'PolynomialFeatures()' assert cuSimpleImputer().__repr__() == 'SimpleImputer()' assert cuRobustScaler().__repr__() == 'RobustScaler()' assert cuKBinsDiscretizer().__repr__() == 'KBinsDiscretizer()'
def test_normalizer(clf_dataset, norm): # noqa: F811 X_np, X = clf_dataset normalizer = cuNormalizer(norm=norm, copy=True) t_X = normalizer.fit_transform(X) assert type(t_X) == type(X) normalizer = skNormalizer(norm=norm, copy=True) sk_t_X = normalizer.fit_transform(X_np) assert_allclose(t_X, sk_t_X)
def test_normalizer_sparse(sparse_clf_dataset, norm): # noqa: F811 X_np, X = sparse_clf_dataset if X.format == 'csc': pytest.skip("Skipping CSC matrices") normalizer = cuNormalizer(norm=norm, copy=True) t_X = normalizer.fit_transform(X) assert type(t_X) == type(X) normalizer = skNormalizer(norm=norm, copy=True) sk_t_X = normalizer.fit_transform(X_np) assert_allclose(t_X, sk_t_X)