Skip to content

TST tight tests for GLMs #23619

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

Merged
merged 42 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aa81fb5
TST add rigoros test for GLMs
lorentzenchr Jun 13, 2022
cd06ba7
TST improve test_warm_start
lorentzenchr Jun 13, 2022
a27c7f9
ENH improve lbfgs options for better convergence
lorentzenchr Jun 14, 2022
a5c1fc0
CLN fix test_warm_start
lorentzenchr Jun 14, 2022
9b8519d
TST fix assert singular values in datasets
lorentzenchr Jun 15, 2022
68947b6
CLN address most review comments
lorentzenchr Jun 15, 2022
06a0b79
ENH enable more vebosity levels for lbfgs
lorentzenchr Jun 15, 2022
4d245cf
DOC add whatsnew
lorentzenchr Jun 15, 2022
f6bee64
Merge branch 'main' into glm_tests
lorentzenchr Jun 15, 2022
382d177
CLN remove xfail and clean a bit
lorentzenchr Jun 16, 2022
25fe6e1
CLN docstring about minimum norm
lorentzenchr Jun 16, 2022
4c4582d
More informative repr for the glm_dataset fixture cases
ogrisel Jun 16, 2022
2065a9e
Forgot to run black
ogrisel Jun 16, 2022
5aaaf21
CLN remove unnecessary filterwarnings
lorentzenchr Jun 17, 2022
10da880
CLN address review comments
lorentzenchr Jun 17, 2022
b98273b
Merge branch 'glm_tests' of https://github.com/lorentzenchr/scikit-le…
lorentzenchr Jun 17, 2022
e16d04e
Trigger [all random seeds] on the following tests:
ogrisel Jun 17, 2022
2fa4397
CLN add comment for lbfgs ftol=64 * machine precision
lorentzenchr Jun 17, 2022
bafc7e7
Merge branch 'glm_tests' of https://github.com/lorentzenchr/scikit-le…
lorentzenchr Jun 17, 2022
c0e2422
CLN XXX code comment
lorentzenchr Jun 17, 2022
1149342
Trigger [all random seeds] on the following tests:
lorentzenchr Jun 17, 2022
3dad445
CLN link issue and remove code snippet in comment
lorentzenchr Jun 17, 2022
12525f1
Trigger [all random seeds] on the following tests:
lorentzenchr Jun 17, 2022
556164a
CLN add catch_warnings
lorentzenchr Jun 17, 2022
4fcc1c8
Trigger [all random seeds] on the following tests:
lorentzenchr Jun 17, 2022
3569991
Merge branch 'main' into glm_tests
lorentzenchr Jun 17, 2022
c723f65
Trigger [all random seeds] on the following tests:
lorentzenchr Jun 17, 2022
3458c39
[all random seeds]
lorentzenchr Jun 18, 2022
99f4cf9
Trigger with -Werror [all random seeds]
lorentzenchr Jun 18, 2022
79ec862
ENH increase maxls to 50
lorentzenchr Jun 18, 2022
904e960
[all random seeds]
lorentzenchr Jun 18, 2022
4fd1d9b
Revert "Trigger with -Werror [all random seeds]"
lorentzenchr Jun 18, 2022
e0cde36
trigger normal CI
lorentzenchr Jun 18, 2022
9bb4ae2
DEBUG disable pytest-xdist and run [all random seeds]
ogrisel Jun 20, 2022
1039a6e
Reenable pytest-xdist on CI
ogrisel Jun 20, 2022
0dd1a95
Merge branch 'main' into glm_tests
ogrisel Jun 24, 2022
386d469
review comment from other PR ;-)
lorentzenchr Jun 27, 2022
2a81628
Merge branch 'glm_tests' of https://github.com/lorentzenchr/scikit-le…
lorentzenchr Jun 27, 2022
20f15d7
CLN address some review comments
lorentzenchr Jun 29, 2022
28fdbab
CLN add comment on solver parameter
lorentzenchr Jun 29, 2022
79868af
DOC align whatsnew entries
lorentzenchr Jun 29, 2022
03a1089
Remove xfail from test_glm_regression_hstacked_X [all random seeds]
ogrisel Jun 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion doc/whats_new/v1.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ random sampling procedures.
:pr:`10805` by :user:`Mathias Andersen <MrMathias>` and
:pr:`23471` by :user:`Meekail Zain <micky774>`

- |Enhancement| :class:`linear_model.GammaRegressor`,
:class:`linear_model.PoissonRegressor` and :class:`linear_model.TweedieRegressor`
can reach higher precision with the lbfgs solver, in particular when `tol` is set
to a tiny value. Moreover, `verbose` is now properly propagated to L-BFGS-B.
:pr:`23619` by :user:`Christian Lorentzen <lorentzenchr>`.

Changes impacting all modules
-----------------------------

Expand Down Expand Up @@ -146,6 +152,12 @@ Changelog
`solver="newton-cg"`, `fit_intercept=True`, and a single feature. :pr:`23608`
by `Tom Dupre la Tour`_.

- |Enhancement| :class:`linear_model.GammaRegressor`,
:class:`linear_model.PoissonRegressor` and :class:`linear_model.TweedieRegressor`
can reach higher precision with the lbfgs solver, in particular when `tol` is set
to a tiny value. Moreover, `verbose` is now properly propagated to L-BFGS-B.
:pr:`23619` by :user:`Christian Lorentzen <lorentzenchr>`.

- |API| The default value for the `solver` parameter in
:class:`linear_model.QuantileRegressor` will change from `"interior-point"`
to `"highs"` in version 1.4.
Expand All @@ -158,7 +170,7 @@ Changelog
negative likelihood ratios derived from the confusion matrix
of a binary classification problem. :pr:`22518` by
:user:`Arturo Amor <ArturoAmorQ>`.

- |Fix| :func:`metrics.ndcg_score` will now trigger a warning when the `y_true`
value contains a negative value. Users may still use negative values, but the
result may not be between 0 and 1. Starting in v1.4, passing in negative
Expand Down
8 changes: 6 additions & 2 deletions sklearn/linear_model/_glm/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,13 @@ def fit(self, X, y, sample_weight=None):
jac=True,
options={
"maxiter": self.max_iter,
"iprint": (self.verbose > 0) - 1,
"maxls": 50, # default is 20
"iprint": self.verbose - 1,
"gtol": self.tol,
"ftol": 1e3 * np.finfo(float).eps,
# The constant 64 was found empirically to pass the test suite.
# The point is that ftol is very small, but a bit larger than
# machine precision for float64, which is the dtype used by lbfgs.
"ftol": 64 * np.finfo(float).eps,
},
args=(X, y, sample_weight, l2_reg_strength, n_threads),
)
Expand Down
Loading