Skip to content

Commit a579b0c

Browse files
committed
Merge branch 'main' of github.com:scikit-learn-contrib/skglm into intercept_v2
2 parents ad47b19 + 5efeb8f commit a579b0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2285
-393
lines changed

.circleci/config.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build_docs:
44
docker:
5-
- image: circleci/python:3.8.1-buster
5+
- image: cimg/python:3.10
66
steps:
77
- checkout
88
- run:
@@ -32,6 +32,13 @@ jobs:
3232
keys:
3333
- pip-cache
3434

35+
# Install Xvfb and related dependencies
36+
- run:
37+
name: Install Xvfb and dependencies
38+
command: |
39+
sudo apt-get update
40+
sudo apt-get install -y xvfb
41+
3542
- run:
3643
name: Spin up Xvfb
3744
command: |
@@ -67,31 +74,28 @@ jobs:
6774
cd ..;
6875
6976
70-
# Deploy docs
77+
# Add stable doc
78+
- run:
79+
name: add stable doc
80+
command: |
81+
set -e
82+
mkdir -p ~/.ssh
83+
echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config
84+
chmod og= ~/.ssh/config
85+
cd doc;
86+
make add-stable-doc;
87+
88+
89+
# upload to gh-pages
7190
- run:
7291
name: deploy
7392
command: |
7493
if [[ ${CIRCLE_BRANCH} == "main" ]]; then
75-
set -e
76-
mkdir -p ~/.ssh
77-
echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config
78-
chmod og= ~/.ssh/config
7994
cd doc;
8095
pip install ghp-import;
81-
make add-stable-doc
8296
make install
8397
fi
8498
85-
# Add stable documentation
86-
- run:
87-
name: stable_doc
88-
command: |
89-
set -e
90-
mkdir -p ~/.ssh
91-
echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config
92-
chmod og= ~/.ssh/config
93-
cd doc;
94-
make add-stable-doc
9599
96100
# Save the outputs
97101
- store_artifacts:

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ Any detail to be able to relate the PR changes
1515
### Checks before merging PR
1616

1717
- [ ] added documentation for any new feature
18-
- [ ] added unittests
19-
- [ ] edited the [what's new](../doc/changes/whats_new.rst)(if applicable)
18+
- [ ] added unit tests
19+
- [ ] edited the [what's new](../doc/changes/whats_new.rst) (if applicable)

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
- name: Check doc style with pydocstyle
3131
run: |
3232
pip install pydocstyle
33-
pydocstyle skglm --ignore='D100',D102,'D104','D107','D203','D213','D413'
33+
pydocstyle skglm --ignore='D100',D102,'D104','D105','D107','D203','D213','D413',

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: Set up Python 3.8
16+
- name: Set up Python 3.10
1717
uses: actions/setup-python@v3
1818
with:
19-
python-version: 3.8
19+
python-version: "3.10"
2020
- name: Install package and testing tools
2121
run: |
2222
python -m pip install --upgrade pip
2323
pip install .
2424
pip install .[test]
2525
- name: Install other dependencies
2626
run: |
27-
pip install celer
27+
conda install rpy2 -c conda-forge
2828
pip install statsmodels cvxopt
29-
pip install git+https://github.com/jolars/pyslope.git
29+
pip install sortedl1
3030
# for testing Cox estimator
3131
pip install lifelines
3232
pip install pandas

CITATION.bib

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@inproceedings{skglm,
2+
title = {Beyond L1: Faster and better sparse models with skglm},
3+
author = {Q. Bertrand and Q. Klopfenstein and P.-A. Bannier and G. Gidel and M. Massias},
4+
booktitle = {NeurIPS},
5+
year = {2022},
6+
}

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
As part of the [scikit-learn-contrib](https://github.com/scikit-learn-contrib) GitHub organization, we adopt the scikit-learn [code of conduct](https://github.com/scikit-learn/scikit-learn/blob/main/CODE_OF_CONDUCT.md).

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<img src="doc/_static/images/logo.svg" alt="skglm logo" width="34%" align="center"/>
44

5+
56
## A fast ⚡ and modular ⚒️ scikit-learn replacement for sparse GLMs
67

78
![build](https://github.com/scikit-learn-contrib/skglm/workflows/pytest/badge.svg)
@@ -19,6 +20,24 @@ You get to choose from ``skglm``'s already-made estimators or **customize your o
1920

2021
Excited to have a tour on ``skglm`` [documentation](https://contrib.scikit-learn.org/skglm/)?
2122

23+
# Cite
24+
25+
``skglm`` is the result of perseverant research. It is licensed under [BSD 3-Clause](https://github.com/scikit-learn-contrib/skglm/blob/main/LICENSE). You are free to use it and if you do so, please cite
26+
27+
```bibtex
28+
@inproceedings{skglm,
29+
title = {Beyond L1: Faster and better sparse models with skglm},
30+
author = {Q. Bertrand and Q. Klopfenstein and P.-A. Bannier and G. Gidel and M. Massias},
31+
booktitle = {NeurIPS},
32+
year = {2022},
33+
}
34+
35+
@article{moufad2023skglm,
36+
title={skglm: improving scikit-learn for regularized Generalized Linear Models},
37+
author={Moufad, Badr and Bannier, Pierre-Antoine and Bertrand, Quentin and Klopfenstein, Quentin and Massias, Mathurin},
38+
year={2023}
39+
}
40+
```
2241

2342
# Why ``skglm``?
2443

@@ -45,10 +64,10 @@ There are several reasons to opt for ``skglm`` among which:
4564
pip install -U skglm
4665
```
4766

48-
It is also available on Conda _(not yet, but very soon...)_ and can be installed via the command
67+
It is also available on conda-forge and can be installed using, for instance:
4968

5069
```shell
51-
conda install skglm
70+
conda install -c conda-forge skglm
5271
```
5372

5473
## First steps with ``skglm``
@@ -59,7 +78,7 @@ Once you installed ``skglm``, you can run the following code snippet to fit a MC
5978
# import model to fit
6079
from skglm.estimators import MCPRegression
6180
# import util to create a toy dataset
62-
from skglm.utils import make_correlated_data
81+
from skglm.utils.data import make_correlated_data
6382

6483
# generate a toy dataset
6584
X, y, _ = make_correlated_data(n_samples=10, n_features=100)
@@ -82,13 +101,15 @@ from skglm.datafits import Huber
82101
from skglm.penalties import MCPenalty
83102
from skglm.estimators import GeneralizedLinearEstimator
84103

85-
from skglm.utils import make_correlated_data
104+
from skglm.utils.data import make_correlated_data
105+
from skglm.solvers import AndersonCD
86106

87107
X, y, _ = make_correlated_data(n_samples=10, n_features=100)
88108
# create and fit GLM estimator with Huber loss and MCP penalty
89109
estimator = GeneralizedLinearEstimator(
90110
datafit=Huber(delta=1.),
91111
penalty=MCPenalty(alpha=1e-2, gamma=3),
112+
solver=AndersonCD()
92113
)
93114
estimator.fit(X, y)
94115
```
@@ -106,18 +127,7 @@ You can also take our tutorial to learn how to create your own datafit and penal
106127
- **pull request**: you may have fixed a bug, added a features, or even fixed a small typo in the documentation, ... you can submit a [pull request](https://github.com/scikit-learn-contrib/skglm/pulls) and we will reach out to you asap.
107128

108129

109-
# Cite
110130

111-
``skglm`` is the result of perseverant research. It is licensed under [BSD 3-Clause](https://github.com/scikit-learn-contrib/skglm/blob/main/LICENSE). You are free to use it and if you do so, please cite
112-
113-
```bibtex
114-
@inproceedings{skglm,
115-
title = {Beyond L1: Faster and better sparse models with skglm},
116-
author = {Q. Bertrand and Q. Klopfenstein and P.-A. Bannier and G. Gidel and M. Massias},
117-
booktitle = {NeurIPS},
118-
year = {2022},
119-
}
120-
```
121131

122132

123133
# Useful links

doc/_templates/sidebar/version_toggler.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
<div style="display: flex; align-items: center; gap: 0.25em;">
55
<span class="{{ 'sidebar-version-selected' if is_stable_doc else '' }}">
6-
<a style=" text-decoration: none;" href="stable/index.html">
6+
<a style=" text-decoration: none;" href="https://contrib.scikit-learn.org/skglm/stable/index.html">
77
Stable
88
</a>
99
</span>
1010

1111
<span class="{{ '' if is_stable_doc else 'sidebar-version-selected' }}">
12-
<a style="text-decoration: none;" href="../index.html">
12+
<a style="text-decoration: none;" href="https://contrib.scikit-learn.org/skglm/">
1313
Dev
1414
</a>
1515
</span>
1616
</div>
17-
</div>
17+
</div>

doc/api.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Estimators
1717
GeneralizedLinearEstimator
1818
CoxEstimator
1919
ElasticNet
20+
GroupLasso
2021
Lasso
2122
LinearSVC
2223
SparseLogisticRegression
@@ -67,7 +68,9 @@ Datafits
6768
Poisson
6869
Quadratic
6970
QuadraticGroup
71+
QuadraticHessian
7072
QuadraticSVC
73+
WeightedQuadratic
7174

7275

7376
Solvers
@@ -100,4 +103,4 @@ Experimental
100103
PDCD_WS
101104
Pinball
102105
SqrtQuadratic
103-
SqrtLasso
106+
SqrtLasso

doc/changes/0.4.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
.. _changes_0_4:
22

3-
Version 0.4 (in progress)
3+
Version 0.4 (2023/04/08)
44
-------------------------
5+
- Add :ref:`GroupLasso Estimator <skglm.GroupLasso>` (PR: :gh:`228`)
6+
- Add support and tutorial for positive coefficients to :ref:`Group Lasso Penalty <skglm.penalties.WeightedGroupL2>` (PR: :gh:`221`)
7+
- Check compatibility with datafit and penalty in solver (PR :gh:`137`)
8+
- Add support to weight samples in the quadratic datafit :ref:`Weighted Quadratic Datafit <skglm.datafit.WeightedQuadratic>` (PR: :gh:`258`)
9+
- Add support for ElasticNet regularization (`penalty="l1_plus_l2"`) to :ref:`SparseLogisticRegression <skglm.SparseLogisticRegression>` (PR: :gh:`244`)
10+
11+
Version 0.3.1 (2023/12/21)
12+
--------------------------
513
- Add support for weights and positive coefficients to :ref:`MCPRegression Estimator <skglm.MCPRegression>` (PR: :gh:`184`)
614
- Move solver specific computations from ``Datafit.initialize()`` to separate ``Datafit`` methods to ease ``Solver`` - ``Datafit`` compatibility check (PR: :gh:`192`)
715
- Add :ref:`LogSumPenalty <skglm.penalties.LogSumPenalty>` (PR: :gh:`#127`)

0 commit comments

Comments
 (0)