def test_warning_n_components_greater_than_n_features():
    n_features = 20
    data, _ = make_sparse_random_data(5, n_features, int(n_features / 4))

    for RandomProjection in all_RandomProjection:
        assert_warns(DataDimensionalityWarning,
                     RandomProjection(n_components=n_features + 1).fit, data)
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/tests/test_random_projection.py/test_warning_n_components_greater_than_n_features/original