def test_robust_scale_sparse( sparse_clf_dataset, # noqa: F811 axis, with_scaling, quantile_range): X_np, X = sparse_clf_dataset if X.format != 'csc' and axis == 0: X = X.tocsc() elif X.format != 'csr' and axis == 1: X = X.tocsr() t_X = cu_robust_scale(X, axis=axis, with_centering=False, with_scaling=with_scaling, quantile_range=quantile_range, copy=True) assert type(t_X) == type(X) sk_t_X = sk_robust_scale(X_np, axis=axis, with_centering=False, with_scaling=with_scaling, quantile_range=quantile_range, copy=True) assert_allclose(t_X, sk_t_X)
def test_robust_scale(clf_dataset, with_centering, # noqa: F811 axis, with_scaling, quantile_range): X_np, X = clf_dataset t_X = cu_robust_scale(X, axis=axis, with_centering=with_centering, with_scaling=with_scaling, quantile_range=quantile_range, copy=True) assert type(t_X) == type(X) sk_t_X = sk_robust_scale(X_np, axis=axis, with_centering=with_centering, with_scaling=with_scaling, quantile_range=quantile_range, copy=True) assert_allclose(t_X, sk_t_X)