Class L1

All Implemented Interfaces:
Regularizer

public class L1 extends L1L2
A regularizer that applies an L1 or Lasso(least absolute shrinkage and selection operator) Regression, regularization penalty.

The L1 regularization penalty is computed as: loss = l1 * reduceSum(abs(x))

  • Constructor Details

    • L1

      public L1()
      Create a regularizer that applies an L1 regularization penalty of AbstractRegularizer.DEFAULT_REGULARIZATION_PENALTY and a name based on the class name.
    • L1

      public L1(String name)
      Create a regularizer that applies an L1 regularization penalty of AbstractRegularizer.DEFAULT_REGULARIZATION_PENALTY
      Parameters:
      name - the name for this AbstractRegularizer
    • L1

      public L1(float l1)
      Create a regularizer that applies an L1 regularization penalty and a name based on the class name.
      Parameters:
      l1 - the L1 regularization penalty
      Throws:
      IllegalArgumentException - if the l1 regularization factor is NaN or is infinite.
    • L1

      public L1(String name, float l1)
      Create a regularizer that applies an L1 regularization penalty
      Parameters:
      name - the name for this AbstractRegularizer
      l1 - the L1 regularization penalty
      Throws:
      IllegalArgumentException - if the l1 regularization factor is NaN or is infinite.