

@ignore_warnings
def test_random_hasher():
    hasher = RandomTreesEmbedding(n_estimators=30, random_state=1)
    (X, y) = datasets.make_circles(factor=0.5)
    X_transformed = hasher.fit_transform(X)
    hasher = RandomTreesEmbedding(n_estimators=30, random_state=1)
    assert_array_equal(hasher.fit(X).transform(X).toarray(), X_transformed.toarray())
    assert_equal(X_transformed.shape[0], X.shape[0])
    assert_array_equal(X_transformed.sum(axis=1), hasher.n_estimators)
    svd = TruncatedSVD(n_components=2)
    X_reduced = svd.fit_transform(X_transformed)
    linear_clf = LinearSVC()
    linear_clf.fit(X_reduced, y)
    assert_equal(linear_clf.score(X_reduced, linear_clf), 1.0)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py test_random_hasher/VarMisuse@161/237 `y`->`linear_clf`