Commit 6cda605
Fix an error in ProbWeightRegression when cvxpy fails to converge (#768)
* fix: raise clear error in `ProbWeightRegression` when cvxpy fails to solve
When input features have very large values, cvxpy may fail to find a
solution, leaving coefficients as None. This caused a confusing error
during predict (matrix multiplication with None). Now a ValueError is
raised at fit time with the solver status and a suggestion to apply
feature scaling.
* Update sklego/linear_model.py
Co-authored-by: Francesco Bruzzesi <42817048+FBruzzesi@users.noreply.github.com>
---------
Co-authored-by: Francesco Bruzzesi <42817048+FBruzzesi@users.noreply.github.com>1 parent c200c79 commit 6cda605
File tree
2 files changed
+18
-0
lines changed- sklego
- tests/test_estimators
2 files changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments