Centering the design matrix cancels one of its singular values when n < p. This creates a numeric mess in the RidgeCV computation.
An example of the bad behaviour is given in:
I'm still not fully sure about the right solution. Comments welcome !
Thanks for the report! Any idea how to fix this?
i looked into it:
you'll see that if X is rank deficient even your code @bthirion fails to find the good alpha.
I think both implementations match. So the questions is how to fix these 10 lines of code
to it works with a rank deficient X....