Enable grid_search with classifiers that fail on individual training folds#2587
Enable grid_search with classifiers that fail on individual training folds#2587romaniukm wants to merge 1 commit into
Conversation
|
Is anyone interested in this code? |
|
Probably. I'll take a look. |
There was a problem hiding this comment.
The duplication could be avoided with something like clf.fit(*fit_args, **fit_params) where fit_args is set differently for the y is None and y is not None cases. (In some PR related to grid search somewhere I have implemented it this way, but the remainder of the PR was too controversial to merge as yet.)
|
I finally got back to working on this and now I'm wondering what I should do about the divergence between master and my local branch. Should I rebase my branch or merge it with the current master? |
|
Usually we use rebase... On 22 January 2014 07:59, Michal Romaniuk [email protected] wrote:
|
|
I noticed that the master diverged quite significantly from my branch and the functionality I'm working on was moved to |
|
Yes, making a new branch sound sensible. Usually a doctest failure will give more information than that: what was printed, and what expected. The code it tests is written in a docstring comment, probably here: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/grid_search.py#L502 |
|
The output says this: |
|
As I thought. It's because the previous doctest doesn't know about On 23 January 2014 09:08, Michal Romaniuk [email protected] wrote:
|
|
I noticed that too :-) I just need to know where these doctests are stored so that I can update it... |
|
"File "/vol/medic02/users/mpr06/sklearn-dev/anaconda/github/ On 23 January 2014 09:26, Michal Romaniuk [email protected] wrote:
|
|
Oh... so it's checking the file against its own documentation... |
|
http://docs.python.org/2/library/doctest.html It checks exactly the printed output, so the parameters need to be in the On 23 January 2014 09:48, Michal Romaniuk [email protected] wrote:
|
|
Ok, I rearranged them alphabetically, but now I'm getting another strange error (sorry about bothering you so much with this!): I already did |
|
run On 24 January 2014 08:30, Michal Romaniuk [email protected] wrote:
|
|
@jnothman thanks for help! It seems to be working now. I created a new branch for this (because the old one was so outdated) so now I wonder if I should issue a new pull request or try to somehow get this one to switch to a different branch (how to do this?). |
|
I don't think you can switch a PR to a different branch, but you can reset this branch to point to the head of the new branch, something like: $ git checkout pr_branch
$ git reset --hard new_branch
$ git push origin pr_branch -f |
|
As Joel said, we prefer rebase, as it gives cleaner histories. However, |
|
Well, what I did was just start from scratch on a fresh checkout from master. So now it's technically an entirely new branch and that's why I'm thinking of opening a new pull request... ----- Reply message ----- As Joel said, we prefer rebase, as it gives cleaner histories. However, — |
Enable grid_search with classifiers that fail on individual training folds.
The improved functionality is repeated in two places, with the same code for the case where y is not None and when y is None. I would welcome a suggestion on how to avoid this duplication. There are also two nearly identical tests for those two cases.