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

Additional instructions for adding new ebm models #1

Open
Lagyamfi opened this issue Mar 9, 2023 · 2 comments
Open

Additional instructions for adding new ebm models #1

Lagyamfi opened this issue Mar 9, 2023 · 2 comments

Comments

@Lagyamfi
Copy link

Lagyamfi commented Mar 9, 2023

Hello,

Thanks for the amazing job done on gam-coach.
I was working through the example of extracting a model and running locally, from (gam_coach_extract_model.ipynb).
I noticed the instructions (which was very easy to follow, by the way) ended after copying the generated json files to the appropriate folders. According to the tutorial, restarting npm should be enough to have the new model show up in the interface.
This didn't work for me and I had to make the following additions to the Article.svelte file.

index b583a4b..1e71cc3 100644
--- a/gamcoach-ui/src/components/article/Article.svelte
+++ b/gamcoach-ui/src/components/article/Article.svelte
@@ -44,6 +44,7 @@
   import samplesCompas from '../../config/data/compas-classifier-random-samples.json';
   import samplesCrime from '../../config/data/crime-classifier-random-samples.json';
   import samplesCrimeFull from '../../config/data/crime-full-classifier-random-samples.json';
+  import samplesMnist from '../../config/data/mnist-classifier-random-samples.json';
 
   export let modelName = 'lc';
 
@@ -59,7 +60,8 @@
     { name: 'adult', display: 'Adult Census Income' },
     { name: 'german', display: 'German Credit' },
     { name: 'compas', display: 'COMPAS' },
-    { name: 'credit', display: 'Credit' }
+    { name: 'credit', display: 'Credit' },
+    { name: 'mnist', display: 'Mnist' },
   ];
 
   const initModelInfo = () => {
@@ -100,6 +102,11 @@
         curIndex = 368;
         break;
       }
+      case 'mnist': {
+        curSamples = samplesMnist;
+        curIndex = 0;
+        break;
+      }
       default: {
         console.warn('Unknown model name');
         curSamples = samplesLC;

I am not sure if I missed something and this change is to be implemented automatically, or does a line or two need to be added in the instructions in the notebook for this?
I would be happy to assist in implementing this if required.

Thanks

@xiaohk
Copy link
Member

xiaohk commented Mar 10, 2023

Hello @Lagyamfi, thanks for trying out GAM Coach!! Yup, your approach is correct! I should be more clear that users need to add these changes in the Article.svelte file to use the new datasets.

I will also consider adding a new page where users can drag-and-drop their json files into the interface (like GAM Changer)

Just curious, what's your use case with GAM Coach? Is mnist the image dataset? 🤔

img

@Lagyamfi
Copy link
Author

Thanks for your response.
Yes definitely, this sort of interface would help a lot. It avoids one having to mess with some of the files unless absolutely required.
I am using MNIST hand digits dataset. My research is on visualization of counterfactuals generally for model builders and end users, and i started the exploration with this dataset but the idea is to transfer it to more real world datasets.
Recently discovered your GAM changer and your accompanying paper; so far one of the best ideas on visualisation of counterfactuals. It is definitely in the right direction. I will be watching this, and contribute where required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants