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 whenlambdasis 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 -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebackfitIterrecord component.doubleReturns the value of thebackfitTolrecord component.intdegree()Returns the value of thedegreerecord component.intdf()Returns the value of thedfrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublelambda()Returns the value of thelambdarecord component.doublelambda(int j) Returns the smoothing parameter for thej-th predictor.double[]lambdas()Returns the value of thelambdasrecord component.intmaxIter()Returns the value of themaxIterrecord component.static GAM.Optionsof(Properties props) Creates options from aPropertiesmap.doubletol()Returns the value of thetolrecord component.Returns the options as aPropertiesmap.final StringtoString()Returns a string representation of this record class.
-
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 thej-th predictor.- Parameters:
j- the predictor index.- Returns:
- the smoothing parameter.
-
toProperties
-
of
Creates options from aPropertiesmap.- Parameters:
props- the properties.- Returns:
- the options.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
lambda
-
lambdas
-
df
-
degree
-
tol
-
maxIter
-
backfitIter
public int backfitIter()Returns the value of thebackfitIterrecord component.- Returns:
- the value of the
backfitIterrecord component
-
backfitTol
public double backfitTol()Returns the value of thebackfitTolrecord component.- Returns:
- the value of the
backfitTolrecord component
-