Explain Model Output

flood_forecast.explain_model_output.handle_dl_output(dl, dl_class: str, datetime_start: datetime.datetime, device: str) Tuple[torch.Tensor, int][source]
Parameters
  • dl (Union[CSVTestLoader, TemporalTestLoader]) – The test data-loader. Should be passed directly

  • dl_class (str) – A string that is the name of DL passef from the params file.

  • datetime_start (datetime) – The start datetime for the forecast

  • device (str) – Typical device should be either cpu or cuda

Returns

Returns a tuple containing either a..

Return type

Tuple[torch.Tensor, int]

flood_forecast.explain_model_output.deep_explain_model_summary_plot(model, csv_test_loader: flood_forecast.preprocessing.pytorch_loaders.CSVTestLoader, datetime_start: Optional[datetime.datetime] = None) None[source]

Generate feature summary plot for trained deep learning models Args:

model (object): trained model csv_test_loader (CSVTestLoader): test data loader datetime_start (datetime, optional): start date of the test prediction,

Defaults to None, i.e. using model inference parameters.

flood_forecast.explain_model_output.fix_shap_values(shap_values, history)[source]
flood_forecast.explain_model_output.deep_explain_model_heatmap(model, csv_test_loader: flood_forecast.preprocessing.pytorch_loaders.CSVTestLoader, datetime_start: Optional[datetime.datetime] = None) None[source]

Generate feature heatmap for prediction at a start time Args:

model ([type]): trained model csv_test_loader ([CSVTestLoader]): test data loader datetime_start (Optional[datetime], optional): start date of the test prediction,

Defaults to None, i.e. using model inference parameters.

Returns:

None