From 8b36911bb7948fda6a11573e65e996eb5b6fce88 Mon Sep 17 00:00:00 2001 From: Kevin P Date: Tue, 4 Mar 2014 15:06:01 -0800 Subject: [PATCH] fix numpy bug in imputation example fixes issue Imputation Training Example Err #2934 I filed. --- examples/imputation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/imputation.py b/examples/imputation.py index aa04521de2950..283121277a9af 100644 --- a/examples/imputation.py +++ b/examples/imputation.py @@ -12,8 +12,8 @@ Script output: Score with the entire dataset = 0.56 - Score without the samples containing missing values = 0.48 - Score after imputation of the missing values = 0.55 + Score without the samples containing missing values = 0.49 + Score after imputation of the missing values = 0.57 """ import numpy as np @@ -48,7 +48,7 @@ # Estimate the score without the lines containing missing values X_filtered = X_full[~missing_samples, :] -y_filtered = y_full[~missing_samples, :] +y_filtered = y_full[~missing_samples] estimator = RandomForestRegressor(random_state=0, n_estimators=100) score = cross_val_score(estimator, X_filtered, y_filtered).mean() print("Score without the samples containing missing values = %.2f" % score)