DOC Accelerate plot_missing_values.py example
@@ -52,8 +52,10 @@ rng = np.random.RandomState(42)
X_diabetes, y_diabetes = load_diabetes(return_X_y=True)
X_california, y_california = fetch_california_housing(return_X_y=True)
-X_california = X_california[:400]
-y_california = y_california[:400]
+X_california = X_california[:300]
+y_california = y_california[:300]
+X_diabetes = X_diabetes[:300]
+y_diabetes = y_diabetes[:300]
def add_missing_values(X_full, y_full):
@@ -98,7 +100,7 @@ from sklearn.model_selection import cross_val_score
from sklearn.pipeline import make_pipeline
-N_SPLITS = 5
+N_SPLITS = 4
regressor = RandomForestRegressor(random_state=0)
# %%
@@ -231,7 +233,8 @@ def get_impute_iterative(X_missing, y_missing):
missing_values=np.nan,
add_indicator=True,
random_state=0,
- n_nearest_features=5,
+ n_nearest_features=3,
+ max_iter=1,
sample_posterior=True,
)
iterative_impute_scores = get_scores_for_imputer(imputer, X_missing, y_missing)
