GAMI-Net Regression (Bike Sharing)

Experiment initialization and data preparation

from piml import Experiment
from piml.models import GAMINetRegressor

exp = Experiment()
exp.data_loader(data="BikeSharing", silent=True)
exp.data_summary(feature_exclude=["yr", "mnth", "temp"], silent=True)
exp.data_prepare(target="cnt", task_type="regression", silent=True)

Train Model

exp.model_train(model=GAMINetRegressor(), name="GAMI-Net")

Evaluate predictive performance

exp.model_diagnose(model="GAMI-Net", show="accuracy_table")
          MSE     MAE       R2

Train  0.0058  0.0536   0.8332
Test   0.0062  0.0551   0.8241
Gap    0.0004  0.0014  -0.0091

Global effect plot for hr and weekday

exp.model_interpret(model="GAMI-Net", show="global_effect_plot", bi_features=["hr", "weekday"],
                    original_scale=True, figsize=(5, 4))
hr x weekday (2.7%)

Global effect plot for hr

exp.model_interpret(model="GAMI-Net", show="global_effect_plot", uni_feature="hr",
                    original_scale=True, figsize=(5, 4))
hr (49.5%)

Global effect plot for weekday

exp.model_interpret(model="GAMI-Net", show="global_effect_plot", uni_feature="weekday", figsize=(5, 4))
weekday (0.0%)

Effect importance

exp.model_interpret(model="GAMI-Net", show="global_ei", figsize=(5, 4))
Effect Importance

Feature importance

exp.model_interpret(model="GAMI-Net", show="global_fi", figsize=(5, 4))
Feature Importance

Local interpretation by effect

exp.model_interpret(model='GAMI-Net', show="local_ei", sample_id=0, original_scale=True, figsize=(5, 4))
Predicted: 0.0677 | Actual: 0.1600

Local interpretation by feature

exp.model_interpret(model='GAMI-Net', show="local_fi", sample_id=0, original_scale=True, figsize=(5, 4))
Predicted: 0.0677 | Actual: 0.1600

Total running time of the script: ( 2 minutes 17.495 seconds)

Estimated memory usage: 308 MB

Gallery generated by Sphinx-Gallery