-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] Make IterativeImputer doctest more stable #13026
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
Conversation
Ping @sergeyf |
Wow is 'heisenburg' a common bug type? How appropriate =) |
Oh I'm familiar with the uncertainty principle etc. I was just wondering if it's a common term for software bugs. |
Follow the link. |
So we have failures on all Travis instances, despite apparent success on the doctest!
I'm not getting that failure locally. |
I suspect that because of the iterative nature of this optimisation, small differences in floating points result in large changes to the learnt coefficients. On my machine these are the RidgeCV models learnt in the example:
on Travis:
I still don't understand why we're sometimes getting the doctest passing on Travis, and sometimes getting it failing... Something else we see is that there are some sudden shifts in the fits. Iterations 15-17 on my machine and iteration 13 on Travis are very different to the ones before (noting that the iterations cycle between two features, so compare all odds to odds and evens to evens). I suspect that these are due to discrete changes in best alpha in RidgeCV (and will check soon). It's very possible that early stopping would fix this, with a sufficiently large tolerance. |
For the early stopping argument, here are the first few iterations of training data imputation:
Are we seriously improving the imputation with changes in the order of 3e-6? Maybe we are, and should let the model spend more time forgetting its initialisation? |
And yes, those sudden changes in model are due to sudden changes in choice of alpha. Does this make RidgeCV a bad choice, or just bad for toy data with two features? |
If floating point differences are actually changing which alpha gets chosen, I'm guessing it's a toy feature issue. I would bet floating point differences probably matter less if you have many more samples. Can you see if a different |
Experimenting with more data (just making some data with two features and some random covariance from
|
I like the idea of making |
I don't think we need to add the heisenbug test. We need to make the example more stable by making the linear fit unequivocal, e.g. with
However, this assumption of linear covariance is probably poor in practice, and wouldn't be learnt by a decision tree. |
I can add the BayesianRidge change and doc change in the MICE PR or the
other one. Let me know.
…On Tue, Jan 22, 2019, 3:50 PM Joel Nothman ***@***.*** wrote:
I don't think we need to add the heisenbug test. We need to make the
example more stable by including making the linear fit unequivocal, e.g.
with
imp.fit([[np.nan, 3], [7, np.nan], [1, 2], [2, 4], [4, 8]])
However, this assumption of linear covariance is probably poor in
practice, and wouldn't be learnt by a decision tree.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13026 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABya7AvBJ-qoN0CD0n-gXqLVML5neC47ks5vF6PYgaJpZM4aL9Wk>
.
|
Awesome! Just to be clear, which PR should change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jnothman !
The change to the default predictor can be its own small pr. Thanks
|
Merging as a minor doc fix |
At #11977 and related PRs, we've been encountering a troublesome doctest that sometimes fails with:
This PR is to help us debug what might be going on... To see, for instance, if we can get the issue to occur outside of a doctest context on some travis instances and not others.