.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples\3_models\plot_7_gaminet_reg.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_3_models_plot_7_gaminet_reg.py: GAMI-Net Regression (Bike Sharing) ===================================== .. GENERATED FROM PYTHON SOURCE LINES 8-9 Experiment initialization and data preparation .. GENERATED FROM PYTHON SOURCE LINES 9-17 .. code-block:: default 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) .. GENERATED FROM PYTHON SOURCE LINES 18-19 Train Model .. GENERATED FROM PYTHON SOURCE LINES 19-21 .. code-block:: default exp.model_train(model=GAMINetRegressor(), name="GAMI-Net") .. GENERATED FROM PYTHON SOURCE LINES 22-23 Evaluate predictive performance .. GENERATED FROM PYTHON SOURCE LINES 23-25 .. code-block:: default exp.model_diagnose(model="GAMI-Net", show="accuracy_table") .. rst-class:: sphx-glr-script-out .. code-block:: none MSE MAE R2 Train 0.0058 0.0536 0.8332 Test 0.0062 0.0551 0.8241 Gap 0.0004 0.0014 -0.0091 .. GENERATED FROM PYTHON SOURCE LINES 26-27 Global effect plot for hr and weekday .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: default exp.model_interpret(model="GAMI-Net", show="global_effect_plot", bi_features=["hr", "weekday"], original_scale=True, figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_001.png :alt: hr x weekday (2.7%) :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 31-32 Global effect plot for hr .. GENERATED FROM PYTHON SOURCE LINES 32-35 .. code-block:: default exp.model_interpret(model="GAMI-Net", show="global_effect_plot", uni_feature="hr", original_scale=True, figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_002.png :alt: hr (49.5%) :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 36-37 Global effect plot for weekday .. GENERATED FROM PYTHON SOURCE LINES 37-39 .. code-block:: default exp.model_interpret(model="GAMI-Net", show="global_effect_plot", uni_feature="weekday", figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_003.png :alt: weekday (0.0%) :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 40-41 Effect importance .. GENERATED FROM PYTHON SOURCE LINES 41-43 .. code-block:: default exp.model_interpret(model="GAMI-Net", show="global_ei", figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_004.png :alt: Effect Importance :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_004.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 44-45 Feature importance .. GENERATED FROM PYTHON SOURCE LINES 45-47 .. code-block:: default exp.model_interpret(model="GAMI-Net", show="global_fi", figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_005.png :alt: Feature Importance :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_005.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 48-49 Local interpretation by effect .. GENERATED FROM PYTHON SOURCE LINES 49-51 .. code-block:: default exp.model_interpret(model='GAMI-Net', show="local_ei", sample_id=0, original_scale=True, figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_006.png :alt: Predicted: 0.0677 | Actual: 0.1600 :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_006.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 52-53 Local interpretation by feature .. GENERATED FROM PYTHON SOURCE LINES 53-54 .. code-block:: default exp.model_interpret(model='GAMI-Net', show="local_fi", sample_id=0, original_scale=True, figsize=(5, 4)) .. image-sg:: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_007.png :alt: Predicted: 0.0677 | Actual: 0.1600 :srcset: /auto_examples/3_models/images/sphx_glr_plot_7_gaminet_reg_007.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 2 minutes 17.495 seconds) **Estimated memory usage:** 308 MB .. _sphx_glr_download_auto_examples_3_models_plot_7_gaminet_reg.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/selfexplainml/piml-toolbox/main?urlpath=lab/tree/./docs/_build/html/notebooks/auto_examples/3_models/plot_7_gaminet_reg.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_7_gaminet_reg.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_7_gaminet_reg.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_