Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(samples): Add kernel shap explainer for income model #4772

Merged

Conversation

michaelcheah
Copy link
Contributor

@michaelcheah michaelcheah commented Mar 31, 2023

What this PR does / why we need it:

Adds KernelShap explainer model example for the SKLearn income classifier. Also adds the AnchorTabular explainer to the samples bucket.

This modifies the gs path in the Makefile such that:

  • gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/model.joblib -> gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/classifier/model.joblib`
  • A model-settings.json file is added to the income classifier

The AnchorTabular model will be saved under gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/anchor-explainer/*

The KernelShap model will be saved under gs://seldon-models/scv2/exsamples/${MLSERVER_FOLDER}/income-sklearn/kernel-shap-explainer/*

Important
mlserver-alibi-explain==1.2.4 is only compatible with alibi<=0.9.0. Use mlserver-alibi-explain==1.2.3.dev4 to deploy explainers trained with alibi==0.9.1 or higher

gsutil cp income/model.joblib gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/model.joblib
gsutil cp income/classifier/* gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/classifier/*
gsutil cp income/explainers/anchor-explainer/* gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/anchor-explainer/*
gsutil cp income/explainers/kernel-shap-explainer/* gs://seldon-models/scv2/samples/${MLSERVER_FOLDER}/income-sklearn/kernel-shap-explainer/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will you upload these new files? BTW does * work rather than -r?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is the existing artifacts used anywhere in SCV2?

@michaelcheah michaelcheah force-pushed the add-income-kernel-shap-explainer-samples branch from 0ef00d3 to b19de8e Compare April 11, 2023 09:34
@michaelcheah michaelcheah marked this pull request as ready for review April 11, 2023 09:36
@michaelcheah michaelcheah merged commit 3de894a into SeldonIO:v2 Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants