githubEdit

Explainer examples

Learn how to implement model explainability in Seldon Core using Anchor explainers for both tabular and text data

Explainer Examples

Anchor Tabular Explainer for SKLearn Income Model

cat ./models/income.yaml
apiVersion: mlops.seldon.io/v1alpha1
kind: Model
metadata:
  name: income
spec:
  storageUri: "gs://seldon-models/scv2/examples/mlserver_1.3.5/income/classifier"
  requirements:
  - sklearn
kubectl apply -f ./models/income.yaml -n ${NAMESPACE}
pipeline.mlops.seldon.io/income created
kubectl wait --for condition=ready --timeout=300s model income -n ${NAMESPACE}
model.mlops.seldon.io/income condition met
curl --location 'http://${SELDON_INFER_HOST}/v2/models/income/infer' \
	--header 'Content-Type: application/json'  \
    --data '{"inputs": [{"name": "predict", "shape": [1, 12], "datatype": "FP32", "data": [[47,4,1,1,1,3,4,1,0,0,40,9]]}]}'
{
	"model_name": "income_1",
	"model_version": "1",
	"id": "c65b8302-85af-4bac-aac5-91e3bedebee8",
	"parameters": {},
	"outputs": [
		{
			"name": "predict",
			"shape": [
				1,
				1
			],
			"datatype": "INT64",
			"data": [
				0
			]
		}
	]
}

Anchor Text Explainer for SKLearn Movies Sentiment Model

Last updated

Was this helpful?