Open JeanLescutMuller opened 1 year ago
This problem goes away if we use a more stable numerical solver, such as "lsqr"
, for instance via Ridge
.
Since there is already a plan to allow LinearRegression
to have different solvers and to its default solver to be consistent with Ridge
, I think it this is the best way forward (unless you find cases where "lsqr"
also fails).
See https://github.com/scikit-learn/scikit-learn/issues/22855#issuecomment-1514368256 for more details on the context.
No consistency between C-contiguous and F-contiguous arrays for LinearRegression()
At least for LinearRegression() : In some edge case (when X is almost singular), there is huge difference between C-contiguous and F-contiguous arrays predictions.
Steps/Code to Reproduce
Expected Results
We expect y_pred to be fully equal to y_pred_c. Or at least
np.corrcoef(y_pred, y_pred_c)[0,1] > .99
Actual Results
np.corrcoef(y_pred, y_pred_c)[0,1] # == 0.40295584536349216
Versions