def test_iforest_parallel_regression():
 rng = check_random_state(0)
 (X_train, X_test, y_train, y_test) = train_test_split(boston.data, boston.target, random_state=rng)
 ensemble = IsolationForest(n_jobs=3, random_state=0).fit(X_train)
 ensemble.set_params(n_jobs=1)
 y1 = ensemble.predict(X_test)
 ensemble.set_params(n_jobs=2)
 y2 = ensemble.predict(X_test)
 assert_array_almost_equal(y1, y2)
 ensemble = IsolationForest(n_jobs=1, random_state=0).fit(X_train)
 y3 = ensemble.predict(X_test)
 assert_array_almost_equal(y1, y3)

def test_iforest_parallel_regression ( ) : rng = check_random_state ( 0 ) ( X_train , X_test , y_train , y_test ) = train_test_split ( boston . data , boston . target , random_state = rng ) ensemble = IsolationForest ( n_jobs = 3 , random_state = 0 ) . fit ( X_train ) ensemble . set_params ( n_jobs = 1 ) y1 = ensemble . predict ( X_test ) ensemble . set_params ( n_jobs = 2 ) y2 = ensemble . predict ( X_test ) assert_array_almost_equal ( y1 , y2 ) ensemble = IsolationForest ( n_jobs = 1 , random_state = 0 ) . fit ( X_train ) y3 = ensemble . predict ( X_test ) assert_array_almost_equal ( y1 , y3 )
check parallel regression .