Repository navigation
MRG add common test to check if estimators overwrite their init params - #1518
Conversation
|
Current output |
|
Looks like the tree-growers are again the bad guys ;) |
|
I'm on it already ;) |
|
I would rather see it as the tree-growers having added the most functionality recently, so that is not so well-tested yet ;) |
|
cc @pprett I modified the random state place a bit again ;) |
|
I fixed the I will now do regression, transformers and clustering. In GradientBoostingClassifier, the |
|
I would rather be strict and use |
|
BTW thanks @amueller for automating this kind of checks. |
|
@ogrisel After running the tests I tend to agree. There are only very little estimators that don't do that already, so it would only be minor changes. |
|
Ok, looks better now: It seems GradientBoostingClassifier is both a Classifier and a Regressor (and a transformer)? Have to check that. I now simply forgot the |
|
Is there a reason not to have |
|
If no-one opposed I'll cherry pick the random-state stuff into master and leave the test in the PR for the moment so we can discuss. |
Hmm not really. Anyway, all the |
|
Yeah, you can do that, too. I was wondering why there is the possibility to set 1 at all. That doesn't make sense, right? Is it a marker for "set to default"? Then ok, just don't overwrite it. I just thought it would be slightly more intuitive to have as a default value the value that is actually used. If you read the docstring, you might wonder why someone would want to set that to one. Either way, I'd say just push it to master since it is such a minor change. |
|
Ok, I got it. It is done in such a way that |
|
Also it is not documented ;) |
|
@amueller No, I think you are wrong.
I don't see that necessary since both Anyway, I pushed a fix in #1488 so as not to overwrite
Done :) |
|
Oh, sorry, I had a sign error as you noticed. As it doesn't change the behavior, it doesn't need to be documented. Sorry about that. Thanks for the fix! |
I think that your choice is a good one. It is good to be able to rely on |
+1 |
|
Thanks for your feedback @GaelVaroquaux. Btw, when @glouppe's fix via #1488 is merged, the only ones left are Also setting the 0.13 milestone on this as I feel these are bugs (the doc state two subsequent calls of fit are independent - which was not the case with the random states and with max_features on GradientBoostingClassifier). |
|
I fixed the remaining issues in GradientBoosting. I think it's good to merge now. |
|
travis failure is mldata related |
|
@pprett if you're around I'd like to get your ok for my changes to GBRT |
|
regarding GBRT: code looks good - all tests pass - all benchmarks look good +1 thanks, andy 2013/1/14 Andreas Mueller [email protected]
Peter Prettenhofer |
|
Thanks for checking @pprett :) |
|
LGTM +1 |
|
Ok, I'm merging this... |
Addressing #1108 (checking that
random_stateis not altered) and even a bit more.Currently the test is pretty strict: it checks that the init parameter is not changed AT ALL during
fit.For default values that are set to
Noneand instantiated later, this is a bit stupid.But on the other hand, sometimes
Nonemeans a parameter will be set from the data - so the none should stay there afterfit.What do you think would be a good policy?