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)
A numeric value after applying soft thresholding: \(\text{sign}(z) \cdot \max(|z| - \lambda, 0)\).
A numeric value to be thresholded.
A non-negative numeric value indicating the threshold level (degree of shrinkage).