soft_thresholding | R Documentation |
Applies the soft thresholding operation to a numeric input, commonly used in Lasso and sparse modeling to induce shrinkage and sparsity.
soft_thresholding(z, lambda)
z |
A numeric value to be thresholded. |
lambda |
A non-negative numeric value indicating the threshold level (degree of shrinkage). |
A numeric value after applying soft thresholding:
\text{sign}(z) \cdot \max(|z| - \lambda, 0)
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.