8000 ENH Loss module LogisticRegression (#21808) · thomasjpfan/scikit-learn@eb8dc45 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb8dc45

Browse files
lorentzenchrogriselagramfort
authored andcommitted
ENH Loss module LogisticRegression (scikit-learn#21808)
* ENH replace loss in linear logistic regression * MNT remove logistic regression's own loss functions * CLN remove comment * DOC add whatsnew * DOC more precise whatsnew * CLN restore improvements of scikit-learn#19571 * ENH improve fit time by separating mat-vec in multiclass * DOC update whatsnew * not only a bit ;-) * DOC note memory benefit for multiclass case * trigger CI * trigger CI * CLN rename variable to hess_prod * DOC address reviewer comments * CLN remove C/F for 1d arrays * CLN rename to gradient_per_sample * CLN rename alpha to l2_reg_strength * ENH respect F-contiguity * TST fix sag tests * CLN rename to LinearModelLoss * CLN improve comments according to review * CLN liblinear comment * TST add / move test to test_linear_loss.py * CLN comment placement * trigger CI * CLN add comment about contiguity of raw_prediction * DEBUG debian-32 * DEBUG test only linear_model module * Revert "DEBUG test only linear_model module" This reverts commit 9d6e698. * DEBUG test -k LogisticRegression * Revert "DEBUG test -k LogisticRegression" This reverts commit c203167. * Revert "DEBUG debian-32" This reverts commit ef0b98f. * DEBUG set n_jobs=1 * Revert "DEBUG set n_jobs=1" This reverts commit c7f6f72. * CLN always use n_threads=1 * CLN address review * ENH avoid array copy * CLN simplify L2 norm * CLN rename w to weights * CLN rename to hessian_sum and hx_sum * CLN address review * CLN rename to init arg and attribute to base_loss * CLN apply review suggestion Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org> * CLN base_loss instead of _loss attribute Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
1 parent b9862b9 commit eb8dc45

File tree

6 files changed

+829
-595
lines changed

6 files changed

+829
-595
lines changed

doc/whats_new/v1.1.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,15 @@ Changelog
397397
beginning which speeds up fitting.
398398
:pr:`22206` by :user:`Christian Lorentzen <lorentzenchr>`.
399399

400+
- |Enhancement| :class:`~linear_model.LogisticRegression` is faster for
401+
``solvers="lbfgs"`` and ``solver="newton-cg"``, for binary and in particular for
402+
multiclass problems thanks to the new private loss function module. In the multiclass
403+
case, the memory consumption has also been reduced for these solvers as the target is
404+
now label encoded (mapped to integers) instead of label binarized (one-hot encoded).
405+
The more classes, the larger the benefit.
406+
:pr:`21808`, :pr:`20567` and :pr:`21814` by
407+
:user:`Christian Lorentzen <lorentzenchr>`.
408+
400409
- |Enhancement| Rename parameter `base_estimator` to `estimator` in
401410
:class:`linear_model.RANSACRegressor` to improve readability and consistency.
402411
`base_estimator` is deprecated and will be removed in 1.3.

0 commit comments

Comments
 (0)
0