You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/tutorials/regularization/regularization.md
+20-32Lines changed: 20 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,40 +5,23 @@
5
5
For ridge regularization, you can simply use `SemRidge` as an additional loss function
6
6
(for example, a model with the loss functions `SemML` and `SemRidge` corresponds to ridge-regularized maximum likelihood estimation).
7
7
8
-
For lasso, elastic net and (far) beyond, we provide the `ProximalSEM` package. You can install it and load it alongside `StructuralEquationModels`:
8
+
For lasso, elastic net and (far) beyond, you can load the `ProximalAlgorithms.jl`and `ProximalOperators.jl` packages alongside `StructuralEquationModels`:
The ProximalSEM package does not have any releases yet, and is not well tested - until the first release, use at your own risk and expect interfaces to change without prior notice.
26
-
27
-
Additionally, you need to install and load `ProximalOperators.jl`:
28
-
29
-
```@setup reg
30
-
using ProximalOperators
11
+
using StructuralEquationModels, ProximalAlgorithms, ProximalOperators
`ProximalSEM` provides a new "building block" for the optimizer part of a model, called `SemOptimizerProximal`.
24
+
To estimate regularized models, we provide a "building block" for the optimizer part, called `SemOptimizerProximal`.
42
25
It connects our package to the [`ProximalAlgorithms.jl`](https://github.com/JuliaFirstOrder/ProximalAlgorithms.jl) optimization backend, providing so-called proximal optimization algorithms.
43
26
Those can handle, amongst other things, various forms of regularization.
44
27
@@ -102,7 +85,9 @@ model = Sem(
102
85
We labeled the covariances between the items because we want to regularize those:
103
86
104
87
```@example reg
105
-
ind = param_indices([:cov_15, :cov_24, :cov_26, :cov_37, :cov_48, :cov_68], model)
Instead of explicitely defining a `SemOptimizerProximal` object, you can also pass `engine = :Proximal` and additional keyword arguments to `sem_fit`:
139
+
140
+
```@example reg
141
+
fit = sem_fit(model; engine = :Proximal, operator_g = NormL1(λ))
142
+
```
143
+
154
144
## Second example - mixed l1 and l0 regularization
155
145
156
146
You can choose to penalize different parameters with different types of regularization functions.
@@ -165,16 +155,14 @@ To define a sup of separable proximal operators (i.e. no parameter is penalized
165
155
we can use [`SlicedSeparableSum`](https://juliafirstorder.github.io/ProximalOperators.jl/stable/calculus/#ProximalOperators.SlicedSeparableSum) from the `ProximalOperators` package:
0 commit comments