def test_robust_standard_scaler_sparse():
    scaler = RobustStandardScaler()
    X_observed = scaler.fit_transform(X_sparse)

    assert issparse(X_observed)
    np.testing.assert_array_almost_equal(X_observed.toarray(),
                                         X / np.std(X, axis=0))
def test_robust_standard_dense_with_low_nnz_columns():
    scaler = RobustStandardScaler()
    X_observed = scaler.fit_transform(X_low_nnz)
    np.testing.assert_array_almost_equal(X_observed, X_low_nnz_standardized)
def test_robust_standard_scaler_dense():
    scaler = RobustStandardScaler()
    X_observed = scaler.fit_transform(X)

    np.testing.assert_array_equal(X_observed, X_standardized)