Skip to content

Commit 0a51182

Browse files
committed
Merge pull request scikit-learn#2935 from kevinpCroat/patch-1
FIX error in imputation example
2 parents e317c1a + 8b36911 commit 0a51182

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/imputation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
Script output:
1313
1414
Score with the entire dataset = 0.56
15-
Score without the samples containing missing values = 0.48
16-
Score after imputation of the missing values = 0.55
15+
Score without the samples containing missing values = 0.49
16+
Score after imputation of the missing values = 0.57
1717
1818
"""
1919
import numpy as np
@@ -48,7 +48,7 @@
4848

4949
# Estimate the score without the lines containing missing values
5050
X_filtered = X_full[~missing_samples, :]
51-
y_filtered = y_full[~missing_samples, :]
51+
y_filtered = y_full[~missing_samples]
5252
estimator = RandomForestRegressor(random_state=0, n_estimators=100)
5353
score = cross_val_score(estimator, X_filtered, y_filtered).mean()
5454
print("Score without the samples containing missing values = %.2f" % score)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy