def check_parallel(name, X, y):
 ForestEstimator = FOREST_ESTIMATORS[name]
 forest = ForestEstimator(n_estimators=10, n_jobs=3, random_state=0)
 forest.fit(X, y)
 assert_equal(len(forest), 10)
 forest.set_params(n_jobs=1)
 y1 = forest.predict(X)
 forest.set_params(n_jobs=2)
 y2 = forest.predict(X)
 assert_array_almost_equal(y1, y2, 3)

def check_parallel ( name , X , y ) : ForestEstimator = FOREST_ESTIMATORS [ name ] forest = ForestEstimator ( n_estimators = 10 , n_jobs = 3 , random_state = 0 ) forest . fit ( X , y ) assert_equal ( len ( forest ) , 10 ) forest . set_params ( n_jobs = 1 ) y1 = forest . predict ( X ) forest . set_params ( n_jobs = 2 ) y2 = forest . predict ( X ) assert_array_almost_equal ( y1 , y2 , 3 )
check parallel computations in classification .