Skip to content

[MRG +1] DOC - add example to cross_val_predict and cross_val_score #6446

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 5 commits into from
Apr 20, 2016

Conversation

albahnsen
Copy link
Contributor

Add example code to the cross_val_predict and cross_val_score functions.

Simply load diabetes dataset and using a lasso model show how both functions work.

>>> X = diabetes.data[:150]
>>> y = diabetes.target[:150]
>>> lasso = linear_model.Lasso()
>>> print(cross_val_predict(lasso, X, y)[:5]) # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
Copy link
Member

Choose a reason for hiding this comment

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

I'd remove the [:5] and use ELLIPSIS

@agramfort
Copy link
Member

besides LGTM

@albahnsen
Copy link
Contributor Author

What is LGTM?

I put the :5 otherwise the output would be to long. But I'll change it.

You mean only ELLIPSIS?

besides LGTM


Reply to this email directly or view it on GitHub
#6446 (comment)
.

@nelson-liu
Copy link
Contributor

LGTM =looks good to me. Generally signifies reviewer approval.

On Wed, Feb 24, 2016, 1:45 PM Alejandro Correa Bahnsen <
notifications@github.com> wrote:

What is LGTM?

I put the :5 otherwise the output would be to long. But I'll change it.

You mean only ELLIPSIS?

besides LGTM


Reply to this email directly or view it on GitHub
<
#6446 (comment)

.


Reply to this email directly or view it on GitHub
#6446 (comment)
.

@nelson-liu
Copy link
Contributor

this looks good to me (after fixing the changes @agramfort suggested)

@albahnsen
Copy link
Contributor Author

I adjust the output of cross_val_predict to be saved in y_pred (similar as https://github.com/scikit-learn/scikit-learn/blob/51a765a/sklearn/cross_decomposition/pls_.py#L575)

@agramfort
Copy link
Member

LGTM

@agramfort agramfort changed the title DOC - add example to cross_val_predict and cross_val_score [MRG +1] DOC - add example to cross_val_predict and cross_val_score Feb 25, 2016
@albahnsen
Copy link
Contributor Author

Guys, what is the next step?

@TomDLT
Copy link
Member

TomDLT commented Apr 5, 2016

LGTM.
Your branch is not up to date with current master.
We'll merge as soon as you rebase on top of master and resolve the conflicts.

@tguillemot
Copy link
Contributor

@albahnsen Could you rebase on top of master and resolve the conflicts please ?

@albahnsen
Copy link
Contributor Author

Guys I'm not sure if I did it correctly.

@nelson-liu
Copy link
Contributor

hmm it doesn't seem like you did. you should do the following:
first, sync your master branch with the master branch of scikit-learn/scikit-learn

  • git fetch upstream to get the scikit-learn/scikit-learn changes from master
  • git checkout master to switch to your master branch
  • git rebase upstream/master

Now, you want to put your changes on top of your local master branch (which is now a copy of scikit-learn's master branch)

  • git checkout <feature branch> to switch to your feature branch
  • git rebase master to rebase your work on top of master
  • solve any merge conflicts that come up.
  • inspect your git log with git log, and verify your changes are at the top and the latest changes from scikit-learn's master branch are right below it
  • push to your branch using git push -f

@TomDLT
Copy link
Member

TomDLT commented Apr 20, 2016

You did it, thanks @albahnsen.
Thanks @nelson-liu for the explanations

@TomDLT TomDLT merged commit bd99858 into scikit-learn:master Apr 20, 2016
mannby pushed a commit to mannby/scikit-learn that referenced this pull request Apr 22, 2016
…cikit-learn#6446)

* add example to cross_val_predict and cross_val_score

* fix output of cross_val_predict

* add example to cross_val_predict and cross_val_score

* fix output of cross_val_predict

* fix rebase
TomDLT pushed a commit to TomDLT/scikit-learn that referenced this pull request Oct 3, 2016
…cikit-learn#6446)

* add example to cross_val_predict and cross_val_score

* fix output of cross_val_predict

* add example to cross_val_predict and cross_val_score

* fix output of cross_val_predict

* fix rebase
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