Skip to content

Commit 16abcce

Browse files
jolarscran-robot
authored andcommitted
version 1.0.0
1 parent f4c4df7 commit 16abcce

File tree

198 files changed

+13584
-6276
lines changed

Some content is hidden

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

198 files changed

+13584
-6276
lines changed

DESCRIPTION

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: SLOPE
22
Title: Sorted L1 Penalized Estimation
3-
Version: 0.5.2
3+
Version: 1.0.0
44
Authors@R:
55
c(
66
person(
@@ -17,14 +17,21 @@ Authors@R:
1717
email = "jonas.wallin@stat.lu.se",
1818
comment = c(ORCID = "0000-0003-0381-6593")
1919
),
20-
person("Malgorzata", "Bogdan", role = "aut"),
20+
person(
21+
"Malgorzata",
22+
"Bogdan",
23+
role = "aut",
24+
comment = c(ORCID = "0000-0002-0657-4342")
25+
),
2126
person("Ewout", "van den Berg", role = "aut"),
2227
person("Chiara", "Sabatti", role = "aut"),
2328
person("Emmanuel", "Candes", role = "aut"),
2429
person("Evan", "Patterson", role = "aut"),
2530
person("Weijie", "Su", role = "aut"),
2631
person("Jakub", "Kała", role = "aut"),
2732
person("Krystyna", "Grzesiak", role = "aut"),
33+
person("Mathurin", "Massias", role = "aut"),
34+
person("Quentin", "Klopfenstein", role = "aut"),
2835
person(
2936
"Michal",
3037
"Burdukiewicz",
@@ -66,8 +73,7 @@ Authors@R:
6673
"Qian",
6774
role = "ctb",
6875
comment = "code adapted from 'glmnet'"
69-
),
70-
person("Akarsh", "Goyal", role = "ctb")
76+
)
7177
)
7278
Description: Efficient implementations for Sorted L-One Penalized Estimation
7379
(SLOPE): generalized linear models regularized with the sorted L1-norm
@@ -80,36 +86,41 @@ Description: Efficient implementations for Sorted L-One Penalized Estimation
8086
License: GPL-3
8187
LazyData: true
8288
Depends: R (>= 3.5.0)
83-
Imports: foreach, ggplot2, Matrix, methods, Rcpp
84-
LinkingTo: Rcpp, RcppArmadillo (>= 0.9.850.1.0)
85-
Suggests: bench, caret, glmnet, covr, dplyr, knitr, rmarkdown, scales,
86-
spelling, stringr, testthat (>= 2.1.0), tidyr, vdiffr
89+
Imports: Matrix, methods, Rcpp
90+
LinkingTo: Rcpp, RcppEigen (>= 0.3.4.0.0), BH, bigmemory
91+
Suggests: covr, knitr, rmarkdown, spelling, testthat (>= 2.1.0),
92+
bigmemory
93+
SystemRequirements: C++17
8794
RoxygenNote: 7.3.2
8895
Language: en-US
8996
Encoding: UTF-8
9097
URL: https://jolars.github.io/SLOPE/, https://github.com/jolars/SLOPE
9198
BugReports: https://github.com/jolars/SLOPE/issues
9299
VignetteBuilder: knitr
93100
NeedsCompilation: yes
94-
Packaged: 2025-02-01 21:45:14 UTC; jola
95-
Author: Johan Larsson [aut, cre] (<https://orcid.org/0000-0002-4029-5945>),
96-
Jonas Wallin [aut] (<https://orcid.org/0000-0003-0381-6593>),
97-
Malgorzata Bogdan [aut],
101+
Packaged: 2025-06-30 16:59:56 UTC; jola
102+
Author: Johan Larsson [aut, cre] (ORCID:
103+
<https://orcid.org/0000-0002-4029-5945>),
104+
Jonas Wallin [aut] (ORCID: <https://orcid.org/0000-0003-0381-6593>),
105+
Malgorzata Bogdan [aut] (ORCID:
106+
<https://orcid.org/0000-0002-0657-4342>),
98107
Ewout van den Berg [aut],
99108
Chiara Sabatti [aut],
100109
Emmanuel Candes [aut],
101110
Evan Patterson [aut],
102111
Weijie Su [aut],
103112
Jakub Kała [aut],
104113
Krystyna Grzesiak [aut],
105-
Michal Burdukiewicz [aut] (<https://orcid.org/0000-0001-8926-582X>),
114+
Mathurin Massias [aut],
115+
Quentin Klopfenstein [aut],
116+
Michal Burdukiewicz [aut] (ORCID:
117+
<https://orcid.org/0000-0001-8926-582X>),
106118
Jerome Friedman [ctb] (code adapted from 'glmnet'),
107119
Trevor Hastie [ctb] (code adapted from 'glmnet'),
108120
Rob Tibshirani [ctb] (code adapted from 'glmnet'),
109121
Balasubramanian Narasimhan [ctb] (code adapted from 'glmnet'),
110122
Noah Simon [ctb] (code adapted from 'glmnet'),
111-
Junyang Qian [ctb] (code adapted from 'glmnet'),
112-
Akarsh Goyal [ctb]
123+
Junyang Qian [ctb] (code adapted from 'glmnet')
113124
Maintainer: Johan Larsson <johanlarsson@outlook.com>
114125
Repository: CRAN
115-
Date/Publication: 2025-02-01 23:00:06 UTC
126+
Date/Publication: 2025-06-30 22:10:09 UTC

MD5

Lines changed: 141 additions & 116 deletions
Large diffs are not rendered by default.

NAMESPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ S3method(score,GaussianSLOPE)
1616
S3method(score,MultinomialSLOPE)
1717
S3method(score,PoissonSLOPE)
1818
export(SLOPE)
19-
export(caretSLOPE)
19+
export(cvSLOPE)
20+
export(plotClusters)
2021
export(plotDiagnostics)
2122
export(regularizationWeights)
2223
export(score)
2324
export(sortedL1Prox)
2425
export(trainSLOPE)
2526
import(Matrix)
26-
import(foreach)
2727
importFrom(Rcpp,sourceCpp)
2828
useDynLib(SLOPE, .registration = TRUE)

NEWS.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,124 @@
1+
# SLOPE 1.0.0
2+
3+
This update of SLOPE brings an entirely different C++ implementation of the
4+
underlying package based on the C++ library
5+
[libslope](https://github.com/jolars/libslope). It comes with several large and
6+
breaking changes with respect to the previous version of the package.
7+
8+
We realized that this may throw off some users, and hope that you will be
9+
patient with dealing with the large number of breaking changes.
10+
11+
## Breaking Changes
12+
13+
- The `caretSLOPE()` function that was deprecated has now been removed from the
14+
package.
15+
- Fields `unique`, `violations`, and `active_sets` are no longer stored in the
16+
`SLOPE` object. These fields were typically only used for debugging purposes.
17+
- The `prox_method` and `method` arguments in `SLOPE()` and `sortedL1Prox()`,
18+
respectively, have been removed. The proximal operator is now always computed
19+
using the fast stack-based algorithm. There was never any reason to use the
20+
slower PAVA algorithm.
21+
- The ADMM solver has been removed from the package. Calling `SLOPE()` with
22+
`solver = "admm"` will now throws a warning and the value will be
23+
automatically set to `"auto"`.
24+
- `alpha` is now scaled by `n` (the number of observations) and differences with
25+
respect to the type of scaling are no longer taken into account.
26+
- The object `coefficients` from `SLOPE()` is now a list of sparse matrices
27+
(rather than a three-dimensional array as before). Now it contains only the
28+
coefficients and not the intercepts. The intercepts are instead stored in
29+
`intercepts` in the returned object and are always present even if
30+
`intercept = FALSE`.
31+
- The behavior of `coef.SLOPE()` has changed somewhat, and if
32+
`simplify = FALSE`, then the returned object is now instead a list of sparse
33+
matrices (rather than a three-dimensional array as before).
34+
- The default value of `q` in `SLOPE()` has changed from
35+
`0.1 * min(1, NROW(x) / NCOL(x))` to `0.1`.
36+
- Arguments `sigma`, `n_sigma`, and `lambda_min_ratio` in `SLOPE()` that were
37+
previously deprecated have been removed.
38+
- `SLOPE()` now internally solves the problem normalized by scaling with the
39+
number of observations, which means that values returned in `deviance` and
40+
`prmals` and `duals` if `diagnostics = TRUE` are now scaled by `n`.
41+
- `path_length` in `SLOPE()` now defaults to 100 (previously 20).
42+
- `tol_dev_ratio` in `SLOPE()` now defaults to `0.999` (previously `0.995`).
43+
- Plots from `plot.SLOPE()` now use base R graphics rather than ggplot2. This
44+
means that the plots are more difficult to customize but plot much more faster
45+
when there are many variables and significantly reduces the dependency load of
46+
the package. For plots of trained SLOPE objects, which used to be faceted on
47+
the `q` parameter, the user now needs to use the standard base R graphics API
48+
to facet plots via `par(mfrow = c(1, 2))` or similar.
49+
50+
## Deprecated Functionality
51+
52+
- Arguments `tol_rel_gap`, `tol_infeas`, `tol_abs`, `tol_rel`, `tol_rel_coef` in
53+
`SLOPE()` are now deprecated. The solvers now all rely on the same tolerance
54+
criterion, which is set by `tol` and uses the duality gap normalized by the
55+
current primal value.
56+
- Arguments `screen` and `screen_alg` are now deprecated and have no effect.
57+
Feature screening is always used. These arguments were only used for
58+
debugging.
59+
- The argument `verbosity` in `SLOPE()` is now defunct and has no effect.
60+
- The argument `prox_method` in `SLOPE()` and `sortedL1Prox()` is now defunct
61+
and has no effect.
62+
63+
## New Features
64+
65+
- Centering `x` in `SLOPE()` is now allowed again, even when the matrix is
66+
sparse.
67+
- Out-of-memory matrices are now allowed through the `bigmemory` package. Only
68+
support for dense matrices is available at the moment.
69+
- Centers and scales can now be specified manually by providing vectors to
70+
`center` and `scale` in `SLOPE()`.
71+
- A new solver based on a hybrid method of proximal gradient descent and
72+
coordinate descent is available and used by default by the Gaussian and
73+
binomial families. Use it by specifying `solver = "hybrid"`.
74+
- Solver can now be set to `"auto"`, in which case the package automatically
75+
chooses a solver.
76+
- The returned duality gaps when `diagnostics = TRUE` are now _true_ duality
77+
gaps, computed by guaranteeing that the dual variable is feasible (which was
78+
not the case previously).
79+
- `scale` in `SLOPE()` gains a new option `"max_abs"` which scales the columns
80+
of `x` by their maximum absolute value.
81+
- When `alpha = "estimate"`, there is a now an iteration limit in case the
82+
algorithm does not converge to one set of features. Thanks @RomanParzer.
83+
- `plot.SLOPE()` gains a new argument `magnitudes`, which causes the plot to
84+
only show the magnitudes of the coefficients (which helps if you want to
85+
visualize cluster structure).
86+
- `plot.SLOPE()` gains a new argument `add_labels`, which add numbers for the
87+
coefficients to the plot. Set to `FALSE` by default.
88+
- Relaxed SLOPE models can now be fit by specifying `gamma` in `SLOPE()`.
89+
- `plot.trainedSLOPE()` gains a new argument `index`, to select which of the
90+
hyperparameter combinations to plot for.
91+
- There's a new function `plotClusters()`, which allows plotting the cluster
92+
structure in SLOPE. Thanks, @KrystynaGrzesiak!
93+
- `SLOPE()` gains a new argument `cd_type`, to control the type of coordinate
94+
descent used for the hybrid solver, with options `"cyclical"` and
95+
`"permuted"`.
96+
97+
## Bug Fixes
98+
99+
- Return correct model when training for AUC in `trainSLOPE()`.
100+
101+
## Performance Improvements
102+
103+
The new hybrid algorithm that's implemented in libslope and now used in the
104+
package constitutes a major upgrade in terms of performance.
105+
106+
- The solver is now much more memory-efficient and can avoid copies of the
107+
design matrix entirely by normalizing the columns just-in-time. This is the
108+
standard behavior. Future versions of the package will allow the user to
109+
specify whether to copy (and modify) the design matrix or not.
110+
111+
## Dependencies
112+
113+
We have made an effort to reduce the footprint of the package and reduce the
114+
number of dependencies.
115+
116+
- The package now relies on Eigen (through RcppEigen) rather than Armadillo,
117+
which means that there is no longer any reliance on BLAS and LAPACK libraries.
118+
- The dependency on `ggplot2` is removed.
119+
- The `vdiffr`, `tidyr`, `dplyr`, `bench`, `scales`, and `glmnet` packages in
120+
the `Suggests` field that were used for testing are now removed.
121+
1122
# SLOPE 0.5.2
2123

3124
## Bug Fixes

R/RcppExports.R

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
22
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
33

4-
lambdaSequence <- function(n_lambda, q, theta1, theta2, lambda_type, n) {
5-
.Call(`_SLOPE_lambdaSequence`, n_lambda, q, theta1, theta2, lambda_type, n)
4+
sortedL1ProxCpp <- function(x, lambda) {
5+
.Call(`_SLOPE_sortedL1ProxCpp`, x, lambda)
66
}
77

8-
sortedL1ProxCpp <- function(x, lambda, method) {
9-
.Call(`_SLOPE_sortedL1ProxCpp`, x, lambda, method)
8+
lambdaSequenceCpp <- function(n_lambda, q, theta1, theta2, lambda_type, n) {
9+
.Call(`_SLOPE_lambdaSequenceCpp`, n_lambda, q, theta1, theta2, lambda_type, n)
10+
}
11+
12+
cvSparseCpp <- function(x, y, cv_args, model_args) {
13+
.Call(`_SLOPE_cvSparseCpp`, x, y, cv_args, model_args)
14+
}
15+
16+
cvDenseCpp <- function(x, y, cv_args, model_args) {
17+
.Call(`_SLOPE_cvDenseCpp`, x, y, cv_args, model_args)
1018
}
1119

1220
sparseSLOPE <- function(x, y, control) {
@@ -17,3 +25,7 @@ denseSLOPE <- function(x, y, control) {
1725
.Call(`_SLOPE_denseSLOPE`, x, y, control)
1826
}
1927

28+
bigSLOPE <- function(x, y, control) {
29+
.Call(`_SLOPE_bigSLOPE`, x, y, control)
30+
}
31+

R/SLOPE-package.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#' @useDynLib SLOPE, .registration = TRUE
99
#' @importFrom Rcpp sourceCpp
1010
#' @import Matrix
11-
#' @import foreach
1211
## usethis namespace: end
1312

1413
NULL

0 commit comments

Comments
 (0)