calculate_sobol_indices
calculate_sobol_indices(mean_model, feature_names, data_df, n_samples=1024)Calculates the Total-Order Sobol sensitivity index for the fitted mean model.
Inputs are sampled uniformly between their minimum and maximum in data_df with Saltelli sampling (SALib). Second-order indices are not computed, for speed. Indices are clamped to [0, 1]. A constant input cannot vary, so it is held fixed and given an index of 0.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| mean_model | Any | Fitted model with a predict method. |
required |
| feature_names | list | Names of the inputs, in the model’s column order. | required |
| data_df | pandas.DataFrame | Data used to set each input’s range. | required |
| n_samples | int | Base sample size for Saltelli sampling (ideally a power of 2). Defaults to 1024. | 1024 |
Returns
| Name | Type | Description |
|---|---|---|
| dict | None | dict | None: {feature name: total-order index}, or None if SALib is not installed. |