Calculates feature importance for a model over a specified dataset.
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. |
dataset_splits | Optional [list] | None | A list of dataset splits taken from the dataset argument of upload_dataset. If specified, feature importance will only be calculated over the provided splits. Otherwise, all splits will be used. |
slice_query | Optional [str] | None | A SQL query. If specified, feature importance will only be calculated over the dataset slice specified by the query. |
**kwargs | None | Additional arguments to be passed. Can be one or more of - n_inputs - n_iterations - n_references - ci_confidence_level - impact_not_importance |
PROJECT_ID = 'example_project'
MODEL_ID = 'example_model'
DATASET_ID = 'example_dataset'
feature_importance = client.run_feature_importance(
project_id=PROJECT_ID,
model_id=MODEL_ID,
dataset_id=DATASET_ID
)
PROJECT_ID = 'example_project'
MODEL_ID = 'example_model'
DATASET_ID = 'example_dataset'
slice_query = f""" SELECT * FROM "{DATASET_ID}.{MODEL_ID}" WHERE feature_1 < 20.0 LIMIT 100 """
feature_importance = client.run_feature_importance(
project_id=PROJECT_ID,
model_id=MODEL_ID,
dataset_id=DATASET_ID,
slice_query=slice_query
)
Return Type | Description |
---|---|
dict | A dictionary containing feature importance results. |