

def test_SparseRandomProjection_output_representation():
    for SparseRandomProjection in all_SparseRandomProjection:
        rp = SparseRandomProjection(n_components=10, dense_output=True, random_state=0)
        rp.fit(data)
        assert isinstance(rp.transform(data), np.ndarray)
        sparse_data = sp.csr_matrix(data)
        assert isinstance(rp.transform(rp), np.ndarray)
        rp = SparseRandomProjection(n_components=10, dense_output=False, random_state=0)
        rp = rp.fit(data)
        assert isinstance(rp.transform(data), np.ndarray)
        assert sp.issparse(rp.transform(sparse_data))

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/tests/test_random_projection.py test_SparseRandomProjection_output_representation/VarMisuse@71/100 `sparse_data`->`rp`