Record Class KernelSHAP.Options
java.lang.Object
java.lang.Record
smile.feature.importance.KernelSHAP.Options
- Record Components:
numSamples- maximum number of coalitions to evaluate per instance (0= auto:2 * M + 2048).ridge- L2 regularization parameter for numerical stability (default1e-8).
- All Implemented Interfaces:
Serializable
- Enclosing class:
KernelSHAP<T>
public static record KernelSHAP.Options(int numSamples, double ridge)
extends Record
implements Serializable
KernelSHAP hyperparameters.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thenumSamplesrecord component.static KernelSHAP.Optionsof(Properties props) Returns the options from properties.doubleridge()Returns the value of theridgerecord component.Returns the persistent set of hyperparameters includingsmile.shap.samplessmile.shap.ridgefinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Options
public Options(int numSamples, double ridge) Validates options. -
Options
public Options()Default constructor with auto sample budget and 1e-8 ridge penalty. -
Options
public Options(int numSamples) Constructor with custom sample budget and default ridge penalty.- Parameters:
numSamples- maximum number of coalitions to evaluate per instance.
-
-
Method Details
-
toProperties
Returns the persistent set of hyperparameters includingsmile.shap.samplessmile.shap.ridge
- Returns:
- the persistent properties.
-
of
Returns the options from properties.- Parameters:
props- the hyperparameters.- 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
numSamples
public int numSamples()Returns the value of thenumSamplesrecord component.- Returns:
- the value of the
numSamplesrecord component
-
ridge
-