Runs a point explanation for a given input vector.
Input Parameter | Type | Default | Description |
---|---|---|---|
project_id | str | None | The unique identifier for the project. |
model_id | str | None | A unique identifier for the model. |
dataset_id | str | None | The unique identifier for the dataset. |
df | pd.DataFrame | None | A pandas DataFrame containing a model input vector as a row. If more than one row is included, the first row will be used. |
explanations | Union [str, list] | 'shap' | A string or list of strings specifying which explanation algorithms to run. Can be one or more of - 'fiddler_shapley_values' - 'shap' - 'ig_flex' - 'ig' - 'mean_reset' - 'zero_reset' - 'permute' |
n_permutation | Optional[int] | None | Number of permutations used for fiddler_shapley_values and the permute algorithm. Can be used for both tabular and text data. By default (None), we use 300 permutations. |
n_background | Optional[int] | None | Number of background observations used for fiddler_shapley_values, permute and mean_reset algorithms for tabular data. By default (None), we use 200. |
casting_type | Optional [bool] | False | If True, will try to cast the data in the events to be in line with the data types defined in the model's ModelInfo object. |
return_raw_response | Optional [bool] | False | If True, a raw output will be returned instead of explanation objects. |
PROJECT_ID = 'example_project'
DATASET_ID = 'example_dataset'
MODEL_ID = 'example_model'
df = pd.read_csv('example_data.csv')
explanation = client.run_explanation(
project_id=PROJECT_ID,
model_id=MODEL_ID,
dataset_id=DATASET_ID,
df=df
)
Return Type | Description |
---|---|
Union[fdl.AttributionExplanation, fdl.MulticlassAttributionExplanation, list] | A fdl.AttributionExplanation object, fdl.MulticlassAttributionExplanation object, or list of such objects for each explanation method specified in explanations |