Record Class GAM.Options

java.lang.Object
java.lang.Record
smile.regression.GAM.Options
Record Components:
lambda - the default smoothing parameter for all smooth terms (used when lambdas is null or shorter than the number of predictors).
lambdas - per-predictor smoothing parameters (may be null).
df - the number of basis functions per smooth.
degree - the degree of the B-spline basis (3 = cubic).
tol - the convergence tolerance for PIRLS iterations.
maxIter - the maximum number of outer PIRLS iterations.
backfitIter - the maximum number of backfitting iterations per PIRLS step.
backfitTol - the convergence tolerance for backfitting.
Enclosing class:
GAM

public static record GAM.Options(double lambda, double[] lambdas, int df, int degree, double tol, int maxIter, int backfitIter, double backfitTol) extends Record
GAM hyperparameters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default options constructor.
    Options(double lambda, double[] lambdas, int df, int degree, double tol, int maxIter, int backfitIter, double backfitTol)
    Validates the options.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the backfitIter record component.
    double
    Returns the value of the backfitTol record component.
    int
    Returns the value of the degree record component.
    int
    df()
    Returns the value of the df record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the lambda record component.
    double
    lambda(int j)
    Returns the smoothing parameter for the j-th predictor.
    double[]
    Returns the value of the lambdas record component.
    int
    Returns the value of the maxIter record component.
    of(Properties props)
    Creates options from a Properties map.
    double
    tol()
    Returns the value of the tol record component.
    Returns the options as a Properties map.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Options

      public Options()
      Default options constructor.
    • Options

      public Options(double lambda, double[] lambdas, int df, int degree, double tol, int maxIter, int backfitIter, double backfitTol)
      Validates the options.
  • Method Details

    • lambda

      public double lambda(int j)
      Returns the smoothing parameter for the j-th predictor.
      Parameters:
      j - the predictor index.
      Returns:
      the smoothing parameter.
    • toProperties

      public Properties toProperties()
      Returns the options as a Properties map.
      Returns:
      the properties.
    • of

      public static GAM.Options of(Properties props)
      Creates options from a Properties map.
      Parameters:
      props - the properties.
      Returns:
      the options.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • lambda

      public double lambda()
      Returns the value of the lambda record component.
      Returns:
      the value of the lambda record component
    • lambdas

      public double[] lambdas()
      Returns the value of the lambdas record component.
      Returns:
      the value of the lambdas record component
    • df

      public int df()
      Returns the value of the df record component.
      Returns:
      the value of the df record component
    • degree

      public int degree()
      Returns the value of the degree record component.
      Returns:
      the value of the degree record component
    • tol

      public double tol()
      Returns the value of the tol record component.
      Returns:
      the value of the tol record component
    • maxIter

      public int maxIter()
      Returns the value of the maxIter record component.
      Returns:
      the value of the maxIter record component
    • backfitIter

      public int backfitIter()
      Returns the value of the backfitIter record component.
      Returns:
      the value of the backfitIter record component
    • backfitTol

      public double backfitTol()
      Returns the value of the backfitTol record component.
      Returns:
      the value of the backfitTol record component