sagemaker-python-sdk icon indicating copy to clipboard operation
sagemaker-python-sdk copied to clipboard

Timeseries Explainability Bug - 2.214.0

Open Alex-Wenner-FHR opened this issue 2 years ago • 2 comments

Describe the bug

  • From the documentation and the Schemas, I think I am passing in all of the right information, with the correct types. For whatever reason I am hitting an error giving a schema validation on two keys that are indeed called out in the docs.

analyzer.utils.exceptions.CustomerError: Analysis configuration schema validation error: Key 'time_series_data_config' error: Wrong keys 'dataset_format', 'static_covariates

during the explainability job -

clarify_processor.run_explainability(
    data_config = data_config,
    model_config = model_config,
    explainability_config = asym_shap_val_config,
)

Here is an example of my TimeSeriesDataConfig:

ts_data_config = TimeSeriesDataConfig(
    target_time_series = "[*].target",
    item_id = "[*].source",
    timestamp = "[*].timestamp",
    related_time_series = [f"[*].{r}" for r in related_timeseries],
    static_covariates= [f"[*].{r}" for r in dataset_generation_spec["static_feature_columns"]],
    dataset_format= TimeSeriesJSONDatasetFormat.TIMESTAMP_RECORDS
)
ts_data_config.get_time_series_data_config()

This .get_time_series_data_config() outputs something as follows:

{'target_time_series': '[*].target',
 'item_id': '[*].source',
 'timestamp': '[*].timestamp',
 'related_time_series': ['[*].rt1',
  '[*].rt2',
  '[*].rt3',
  '[*].rt4',
  '[*].rt5',
  '[*].rt6',
  '[*].rt7',
  '[*].rt8',
  '[*].rt9',
  '[*].rt10',
  '[*].rt11',
  '[*].rt12',
  '[*].rt13',
  '[*].rt15',
  '[*].rt16',
  '[*].rt17'],
 'static_covariates': ['[*].sc1',
  '[*].sc2',
  '[*].sc3',
  '[*].sc4'],
 'dataset_format': 'timestamp_records'}


System information

  • SageMaker Python SDK version: 2.214.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): N/A
  • Framework version: N/A
  • Python version: 3.11.0
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N/A

Alex-Wenner-FHR avatar Mar 25 '24 14:03 Alex-Wenner-FHR

Hi Alex, thanks for reaching out. Although we've merged the SDK changes to support time series explainability, the actual feature is not released at the moment. We'll update you when it's available.

rvasahu-amazon avatar Mar 25 '24 17:03 rvasahu-amazon

Please do @rvasahu-amazon this is a high demand feature! Thanks.

Alex-Wenner-FHR avatar Mar 26 '24 13:03 Alex-Wenner-FHR