Skip to content

Instantly share code, notes, and snippets.

@sararob
Last active February 17, 2020 17:18
Show Gist options
  • Save sararob/95b56d58ebcbc6e5ac3aa8a2896f9905 to your computer and use it in GitHub Desktop.
Save sararob/95b56d58ebcbc6e5ac3aa8a2896f9905 to your computer and use it in GitHub Desktop.
Generating explanation metadata for tabular models
# The following explanation metadata can be used for tabular models that accept a numpy array as input
# Write the `explanation_metadat` object below to a JSON file called explanation_metadata.json
explanation_metadata = {
"inputs": {
"data": {
"input_tensor_name": model.input.name,
"input_baselines": [train_data.median().values.tolist()],
"encoding": "bag_of_features",
"index_feature_mapping": train_data.columns.tolist()
}
},
"outputs": {
"duration": {
"output_tensor_name": model.output.name
}
},
"framework": "tensorflow"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment