Welcome to the world of Generalized Additive Models (GAMs)! This interactive visualization tool, known as GAM Changer, has been designed to empower domain experts and data scientists to easily and responsibly edit these models. In this guide, we’ll walk through how to utilize this tool effectively, ensuring a seamless experience.
What is GAM Changer?
GAM Changer is an interactive visualization tool that facilitates the editing of Generalized Additive Models. It’s like having a paintbrush that allows you to artistically adjust and refine a masterpiece, ensuring that the final product resonates with human knowledge and values.
Getting Started with GAM Changer
To kick off your journey, you can access a live demo of GAM Changer by visiting: GAM Changer Demo.
How to Edit Your Own GAMs?
Follow these simple steps to edit your own GAMs:
- Choose the “My Model” tab and upload your
model.json(model weights) andsample.json(sample data for evaluation). - If you are using Enhanced Boosted Trees (EBM), you can easily generate these two files using the GAM Changer Python package.
Code Snippet for Creating model.json and sample.json
# First install the GAM Changer python package
pip install gamchanger
# Import GAM Changer
import gamchanger as gc
from json import dump
# Extract model weights
model_data = gc.get_model_data(ebm)
# Generate sample data
sample_data = gc.get_sample_data(ebm, x_test, y_test)
# Save to model.json and sample.json
dump(model_data, open('.model.json', 'w'))
dump(sample_data, open('.sample.json', 'w'))
Think of the code above as your recipe in a kitchen; it outlines the ingredients (model weights and sample data) you need and the specific steps to prepare your dish (those files) correctly. The resulting model.json and sample.json files act as the base for your new culinary creation in the world of data science!
Using GAM Changer in Computational Notebooks
You can also use GAM Changer within your favorite computational notebooks, such as Jupyter Notebook or Google Colab. Follow these links for live demos:
Use the snippet below to load GAM Changer:
# Install the GAM Changer python package
pip install gamchanger
# Load GAM Changer with the model and sample data
import gamchanger as gc
gc.visualize(ebm, x_feed, y_feed)
Loading Edited Models
Once you’ve made your edits, you can save your new model along with the editing history to a .gamchanger file. To load the modified model, use the following code:
from json import load
import gamchanger as gc
# Load the *.gamchanger file
gc_dict = load(open('.edit-8-27-2021.gamchanger', 'r'))
# Create a deep copy of your original EBM with edits applied
new_ebm = gc.get_edited_model(ebm, gc_dict)
Troubleshooting Tips
If you encounter any issues while using GAM Changer, consider the following troubleshooting ideas:
- Ensure that all necessary files are correctly formatted as
model.jsonandsample.json. - Verify that the GAM Changer package is correctly installed.
- If you face loading issues, restart your computational notebook or environment and try again.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
GAM Changer provides an intuitive interface to edit Generalized Additive Models with ease. The ability to visualize and manipulate models responsibly is not just a technical achievement; it opens the door to more ethical data science practices.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

