8000 [MRG +1] Save predictions in diabetes_y_pred by davidrobles · Pull Request #8241 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG +1] Save predictions in diabetes_y_pred #8241

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

Conversation

davidrobles
Copy link
Contributor
@davidrobles davidrobles commented Jan 28, 2017
  • No need for regr.predict(diabetes_X_test) to run multiple times.
  • Use sklearn.metrics.mean_squared_error.
  • Use sklearn.metrics.r2_score, instead of regr.score, which
    runs regr.predict again.

# The coefficients
print('Coefficients: \n', regr.coef_)
# The mean squared error
print("Mean squared error: %.2f"
% np.mean((regr.predict(diabetes_X_test) - diabetes_y_test) ** 2))
% np.mean((diabetes_y_pred - diabetes_y_test) ** 2))
# Explained variance score: 1 is perfect prediction
print('Variance score: %.2f' % regr.score(diabetes_X_test, diabetes_y_test))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another prediction

@jnothman
Copy link
Member

Thanks!

- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
@davidrobles davidrobles force-pushed the linear-regression-ypred branch from 13d9d6e to 7587daf Compare January 29, 2017 18:32
@davidrobles davidrobles changed the title Save predictions in diabetes_y_pred [MRG] Save predictions in diabetes_y_pred Feb 3, 2017
@jmschrei
Copy link
Member

LGTM, +1.

@jmschrei jmschrei changed the title [MRG] Save predictions in diabetes_y_pred [MRG +1] Save predictions in diabetes_y_pred Feb 27, 2017
@jmschrei
Copy link
Member

@jnothman does this look good to you?

@GaelVaroquaux
Copy link
Member

LGTM. Merging. Thanks for the code contribution and the reviews.

@GaelVaroquaux GaelVaroquaux merged commit 0ab5c67 into scikit-learn:master Feb 27, 2017
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
herilalaina pushed a commit to herilalaina/scikit-learn that referenced this pull request Mar 26, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
massich pushed a commit to massich/scikit-learn that referenced this pull request Apr 26, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
lemonlaug pushed a commit to lemonlaug/scikit-learn that referenced this pull request Jan 6, 2021
- No need for `regr.predict(diabetes_X_test)` to run multiple times.
- Use `sklearn.metrics.mean_squared_error`.
- Use `sklearn.metrics.r2_score`, instead of `regr.score`, which
  runs `regr.predict` again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0