EXA Fix iterative imputer example's speed issue.
@@ -57,6 +57,10 @@ N_SPLITS = 5
rng = np.random.RandomState(0)
X_full, y_full = fetch_california_housing(return_X_y=True)
+# ~2k samples is enough for the purpose of the example.
+# Remove the following two lines for a slower run with different error bars.
+X_full = X_full[::10]
+y_full = y_full[::10]
n_samples, n_features = X_full.shape
# Estimate the score on the entire dataset, with no missing values
@@ -93,7 +97,7 @@ for strategy in ('mean', 'median'):
estimators = [
BayesianRidge(),
DecisionTreeRegressor(max_features='sqrt', random_state=0),
- ExtraTreesRegressor(n_estimators=10, n_jobs=-1, random_state=0),
+ ExtraTreesRegressor(n_estimators=10, random_state=0),
KNeighborsRegressor(n_neighbors=15)
]
score_iterative_imputer = pd.DataFrame()
