Tabular Data Model Explanations
Launch an income prediction model and get explanations on tabular data.
In this demo we will:
- Launch an income classification model which has tabular training features
- Send a request to get a predicton
- Create an explainer for the model
- Send the same request and then get an explanation for it
This model provides a model trained to predict high or low income based on demographic features from a 1996 US census.
Create Model
Use the model url:
gs://seldon-models/sklearn/income/model
Get Predictions
Run a single prediction using the JSON below.
{
"data": {
"names": [
"Age",
"Workclass",
"Education",
"Marital Status",
"Occupation",
"Relationship",
"Race",
"Sex",
"Capital Gain",
"Capital Loss",
"Hours per week",
"Country"
],
"ndarray": [
[
53,
4,
0,
2,
8,
4,
2,
0,
0,
0,
60,
9
]
]
}
}
Add an Anchor Tabular Explainer
Create an model explainer using the URL below for the saved explainer.
gs://seldon-models/sklearn/income/explainer
Get Explanation for one Request
Resend a single request and then explain it using the JSON below:
{
"data": {
"names": [
"Age",
"Workclass",
"Education",
"Marital Status",
"Occupation",
"Relationship",
"Race",
"Sex",
"Capital Gain",
"Capital Loss",
"Hours per week",
"Country"
],
"ndarray": [
[
53,
4,
0,
2,
8,
4,
2,
0,
0,
0,
60,
9
]
]
}
}
Delete Deployment
Finally, delete the deployment.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified October 29, 2019: Reorganizing project structure and adding WIP image explanations (8bfc877)