Tabular Data Classification on Income Dataset

In this demo we will:

  • Create a pipeline which can be used to classify tabular data

  • Create an explainer

  • Send a request to a prediction pipeline

  • View the explanation

Create a pipeline

1. Click on Create new deployment

Create new deployment

2. Name your pipeline

You also need to specify the type as Seldon ML Pipeline.

Name your pipeline

3. Provide model URI

In this demo we’re using this model URI: gs://seldon-models/scv2/examples/income/classifier

Provide model URI

4. Specify model runtime

The example model is a scikit-learn model, so we’ll select scikit-learn as the runtime.

Specify model runtime

5. Name your model

Name your model

Create an explainer

1. Select your pipeline

Select your pipeline

There you’ll find the create button which will allow you to create an explainer for your pipeline. Navigate to explainer

3. Specify your model data type

This model is trained to classify tabular data, so we selected Tabular

Specify your model data type

4. Provide explainer URI

The explainer model URI for this pipeline is gs://seldon-models/scv2/examples/income/explainer

Provide explainer URI

Make a prediction

1. Select your pipeline

Select your pipeline

2. Click on Predict

Click on predict

3. Provide prediction data

For this example please use this payload

    "parameters": {"content_type": "pd"}, 
    "inputs": [
        {"name": "Age", "shape": [1, 1], "datatype": "INT64", "data": [47]},
        {"name": "Workclass", "shape": [1, 1], "datatype": "INT64", "data": [4]},
        {"name": "Education", "shape": [1, 1], "datatype": "INT64", "data": [1]},
        {"name": "Marital Status", "shape": [1, 1], "datatype": "INT64", "data": [1]},
        {"name": "Occupation", "shape": [1, 1], "datatype": "INT64", "data": [1]},
        {"name": "Relationship", "shape": [1, 1], "datatype": "INT64", "data": [3]},
        {"name": "Race", "shape": [1, 1], "datatype": "INT64", "data": [4]},
        {"name": "Sex", "shape": [1, 1], "datatype": "INT64", "data": [1]},
        {"name": "Capital Gain", "shape": [1, 1], "datatype": "INT64", "data": [0]},
        {"name": "Capital Loss", "shape": [1, 1], "datatype": "INT64", "data": [0]},
        {"name": "Hours per week", "shape": [1, 1], "datatype": "INT64", "data": [40]},
        {"name": "Country", "shape": [1, 1], "datatype": "INT64", "data": [9]}

4. View the response

View the response

View the explanation

1. Select your pipeline

Select your pipeline

2. Click on Requests

Click on requests

3. Find the request you made

To view the explanation click on the View explanation button.

Click view explanation

4. View the explanation

Here you can see the explanation for the prediction we made earlier.

Model explanation