8000 fix numpy bug in imputation example by kevinpCroat · Pull Request #2935 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

fix numpy bug in imputation example #2935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/imputation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
0