kernelShap

fun kernelShap(background: Array<DoubleArray>, numSamples: Int = 0, ridge: Double = 1.0E-8, predictor: ToDoubleFunction<DoubleArray>): KernelSHAP<DoubleArray>(source)

Creates a KernelSHAP explainer for a scalar function on DoubleArray.

Return

the KernelSHAP explainer.

Parameters

background

the background reference dataset.

numSamples

maximum number of coalitions to evaluate per instance (0 = auto).

ridge

L2 regularization parameter for numerical stability.

predictor

the scalar prediction function.


fun kernelShap(background: Array<DoubleArray>, model: Regression<DoubleArray>, numSamples: Int = 0, ridge: Double = 1.0E-8): KernelSHAP<DoubleArray>(source)

Creates a KernelSHAP explainer for a Regression model on DoubleArray.

Return

the KernelSHAP explainer.

Parameters

background

the background reference dataset.

model

the regression model.

numSamples

maximum number of coalitions to evaluate per instance (0 = auto).

ridge

L2 regularization parameter for numerical stability.


fun kernelShap(background: Array<DoubleArray>, model: Classifier<DoubleArray>, numSamples: Int = 0, ridge: Double = 1.0E-8): KernelSHAP<DoubleArray>(source)

Creates a KernelSHAP explainer for a Classifier model on DoubleArray.

Return

the KernelSHAP explainer.

Parameters

background

the background reference dataset.

model

the classification model.

numSamples

maximum number of coalitions to evaluate per instance (0 = auto).

ridge

L2 regularization parameter for numerical stability.


fun kernelShap(background: DataFrame, model: DataFrameRegression, numSamples: Int = 0, ridge: Double = 1.0E-8): KernelSHAP<Tuple>(source)

Creates a KernelSHAP explainer for a DataFrameRegression model.

Return

the KernelSHAP explainer.

Parameters

background

the background reference data frame.

model

the DataFrame regression model.

numSamples

maximum number of coalitions to evaluate per instance (0 = auto).

ridge

L2 regularization parameter for numerical stability.


fun kernelShap(background: DataFrame, model: DataFrameClassifier, numSamples: Int = 0, ridge: Double = 1.0E-8): KernelSHAP<Tuple>(source)

Creates a KernelSHAP explainer for a DataFrameClassifier model.

Return

the KernelSHAP explainer.

Parameters

background

the background reference data frame.

model

the DataFrame classifier model.

numSamples

maximum number of coalitions to evaluate per instance (0 = auto).

ridge

L2 regularization parameter for numerical stability.