

def check_warm_start_clear(name):
    (X, y) = (hastie_X, hastie_y)
    ForestEstimator = FOREST_ESTIMATORS[name]
    clf = ForestEstimator(n_estimators=5, max_depth=1, warm_start=False, random_state=1)
    clf.fit(X, y)
    clf_2 = ForestEstimator(n_estimators=5, max_depth=1, warm_start=True, random_state=2)
    clf_2.fit(X, y)
    clf_2.set_params(warm_start=False, random_state=1)
    clf_2.fit(X, y)
    assert_array_almost_equal(clf_2.apply(X), clf.apply(X))

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py check_warm_start_clear/original