.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/03_complex_models/run_hyperparameter_tuning.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_03_complex_models_run_hyperparameter_tuning.py: Tuning Hyperparameters ======================= This example uses the ``fmri`` dataset, performs simple binary classification using a Support Vector Machine classifier and analyze the model. References ---------- Waskom, M.L., Frank, M.C., Wagner, A.D. (2016). Adaptive engagement of cognitive control in context-dependent decision-making. Cerebral Cortex. .. include:: ../../links.inc .. GENERATED FROM PYTHON SOURCE LINES 16-26 .. code-block:: Python # Authors: Federico Raimondo # License: AGPL import numpy as np from seaborn import load_dataset from julearn import run_cross_validation from julearn.utils import configure_logging from julearn.pipeline import PipelineCreator .. GENERATED FROM PYTHON SOURCE LINES 27-28 Set the logging level to info to see extra information. .. GENERATED FROM PYTHON SOURCE LINES 28-30 .. code-block:: Python configure_logging(level="INFO") .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-01-16 10:54:16,367 - julearn - INFO - ===== Lib Versions ===== 2026-01-16 10:54:16,367 - julearn - INFO - numpy: 1.26.4 2026-01-16 10:54:16,367 - julearn - INFO - scipy: 1.17.0 2026-01-16 10:54:16,367 - julearn - INFO - sklearn: 1.7.2 2026-01-16 10:54:16,368 - julearn - INFO - pandas: 2.3.3 2026-01-16 10:54:16,368 - julearn - INFO - julearn: 0.3.5.dev123 2026-01-16 10:54:16,368 - julearn - INFO - ======================== .. GENERATED FROM PYTHON SOURCE LINES 31-32 Set the random seed to always have the same example. .. GENERATED FROM PYTHON SOURCE LINES 32-34 .. code-block:: Python np.random.seed(42) .. GENERATED FROM PYTHON SOURCE LINES 35-36 Load the dataset. .. GENERATED FROM PYTHON SOURCE LINES 36-39 .. code-block:: Python df_fmri = load_dataset("fmri") df_fmri.head() .. raw:: html
subject timepoint event region signal
0 s13 18 stim parietal -0.017552
1 s5 14 stim parietal -0.080883
2 s12 18 stim parietal -0.081033
3 s11 18 stim parietal -0.046134
4 s10 18 stim parietal -0.037970


.. GENERATED FROM PYTHON SOURCE LINES 40-41 Set the dataframe in the right format. .. GENERATED FROM PYTHON SOURCE LINES 41-48 .. code-block:: Python df_fmri = df_fmri.pivot( index=["subject", "timepoint", "event"], columns="region", values="signal" ) df_fmri = df_fmri.reset_index() df_fmri.head() .. raw:: html
region subject timepoint event frontal parietal
0 s0 0 cue 0.007766 -0.006899
1 s0 0 stim -0.021452 -0.039327
2 s0 1 cue 0.016440 0.000300
3 s0 1 stim -0.021054 -0.035735
4 s0 2 cue 0.024296 0.033220


.. GENERATED FROM PYTHON SOURCE LINES 49-50 Let's do a first attempt and use a linear SVM with the default parameters. .. GENERATED FROM PYTHON SOURCE LINES 50-61 .. code-block:: Python X = ["frontal", "parietal"] y = "event" creator = PipelineCreator(problem_type="classification") creator.add("zscore") creator.add("svm", kernel="linear") scores = run_cross_validation(X=X, y=y, data=df_fmri, model=creator) print(scores["test_score"].mean()) .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-01-16 10:54:16,376 - julearn - INFO - Adding step zscore that applies to ColumnTypes 2026-01-16 10:54:16,376 - julearn - INFO - Step added 2026-01-16 10:54:16,376 - julearn - INFO - Adding step svm that applies to ColumnTypes 2026-01-16 10:54:16,377 - julearn - INFO - Setting hyperparameter kernel = linear 2026-01-16 10:54:16,377 - julearn - INFO - Step added 2026-01-16 10:54:16,377 - julearn - INFO - ==== Input Data ==== 2026-01-16 10:54:16,377 - julearn - INFO - Using dataframe as input 2026-01-16 10:54:16,377 - julearn - INFO - Features: ['frontal', 'parietal'] 2026-01-16 10:54:16,377 - julearn - INFO - Target: event 2026-01-16 10:54:16,377 - julearn - INFO - Expanded features: ['frontal', 'parietal'] 2026-01-16 10:54:16,377 - julearn - INFO - X_types:{} 2026-01-16 10:54:16,377 - julearn - WARNING - The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. /home/runner/work/julearn/julearn/julearn/prepare.py:576: RuntimeWarning: The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. warn_with_log( 2026-01-16 10:54:16,378 - julearn - INFO - ==================== 2026-01-16 10:54:16,378 - julearn - INFO - 2026-01-16 10:54:16,379 - julearn - INFO - = Model Parameters = 2026-01-16 10:54:16,379 - julearn - INFO - ==================== 2026-01-16 10:54:16,379 - julearn - INFO - 2026-01-16 10:54:16,379 - julearn - INFO - = Data Information = 2026-01-16 10:54:16,379 - julearn - INFO - Problem type: classification 2026-01-16 10:54:16,379 - julearn - INFO - Number of samples: 532 2026-01-16 10:54:16,379 - julearn - INFO - Number of features: 2 2026-01-16 10:54:16,379 - julearn - INFO - ==================== 2026-01-16 10:54:16,380 - julearn - INFO - 2026-01-16 10:54:16,380 - julearn - INFO - Number of classes: 2 2026-01-16 10:54:16,380 - julearn - INFO - Target type: object 2026-01-16 10:54:16,381 - julearn - INFO - Class distributions: event cue 266 stim 266 Name: count, dtype: int64 2026-01-16 10:54:16,381 - julearn - INFO - Using outer CV scheme KFold(n_splits=5, random_state=None, shuffle=False) 2026-01-16 10:54:16,381 - julearn - INFO - Binary classification problem detected. 0.5939164168576971 .. GENERATED FROM PYTHON SOURCE LINES 62-65 The score is not so good. Let's try to see if there is an optimal regularization parameter (C) for the linear SVM. We will use a grid search to find the best ``C``. .. GENERATED FROM PYTHON SOURCE LINES 65-86 .. code-block:: Python creator = PipelineCreator(problem_type="classification") creator.add("zscore") creator.add("svm", kernel="linear", C=[0.01, 0.1]) search_params = { "kind": "grid", "cv": 2, # to speed up the example } scores, estimator = run_cross_validation( X=X, y=y, data=df_fmri, model=creator, search_params=search_params, return_estimator="final", ) print(scores["test_score"].mean()) .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-01-16 10:54:16,440 - julearn - INFO - Adding step zscore that applies to ColumnTypes 2026-01-16 10:54:16,440 - julearn - INFO - Step added 2026-01-16 10:54:16,440 - julearn - INFO - Adding step svm that applies to ColumnTypes 2026-01-16 10:54:16,440 - julearn - INFO - Setting hyperparameter kernel = linear 2026-01-16 10:54:16,440 - julearn - INFO - Tuning hyperparameter C = [0.01, 0.1] 2026-01-16 10:54:16,440 - julearn - INFO - Step added 2026-01-16 10:54:16,440 - julearn - INFO - ==== Input Data ==== 2026-01-16 10:54:16,441 - julearn - INFO - Using dataframe as input 2026-01-16 10:54:16,441 - julearn - INFO - Features: ['frontal', 'parietal'] 2026-01-16 10:54:16,441 - julearn - INFO - Target: event 2026-01-16 10:54:16,441 - julearn - INFO - Expanded features: ['frontal', 'parietal'] 2026-01-16 10:54:16,441 - julearn - INFO - X_types:{} 2026-01-16 10:54:16,441 - julearn - WARNING - The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. /home/runner/work/julearn/julearn/julearn/prepare.py:576: RuntimeWarning: The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. warn_with_log( 2026-01-16 10:54:16,442 - julearn - INFO - ==================== 2026-01-16 10:54:16,442 - julearn - INFO - 2026-01-16 10:54:16,442 - julearn - INFO - = Model Parameters = 2026-01-16 10:54:16,443 - julearn - INFO - Tuning hyperparameters using grid 2026-01-16 10:54:16,443 - julearn - INFO - Hyperparameters: 2026-01-16 10:54:16,443 - julearn - INFO - svm__C: [0.01, 0.1] 2026-01-16 10:54:16,443 - julearn - INFO - Using inner CV scheme KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:16,443 - julearn - INFO - Search Parameters: 2026-01-16 10:54:16,443 - julearn - INFO - cv: KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:16,443 - julearn - INFO - ==================== 2026-01-16 10:54:16,443 - julearn - INFO - 2026-01-16 10:54:16,444 - julearn - INFO - = Data Information = 2026-01-16 10:54:16,444 - julearn - INFO - Problem type: classification 2026-01-16 10:54:16,444 - julearn - INFO - Number of samples: 532 2026-01-16 10:54:16,444 - julearn - INFO - Number of features: 2 2026-01-16 10:54:16,444 - julearn - INFO - ==================== 2026-01-16 10:54:16,444 - julearn - INFO - 2026-01-16 10:54:16,444 - julearn - INFO - Number of classes: 2 2026-01-16 10:54:16,444 - julearn - INFO - Target type: object 2026-01-16 10:54:16,445 - julearn - INFO - Class distributions: event cue 266 stim 266 Name: count, dtype: int64 2026-01-16 10:54:16,445 - julearn - INFO - Using outer CV scheme KFold(n_splits=5, random_state=None, shuffle=False) (incl. final model) 2026-01-16 10:54:16,446 - julearn - INFO - Binary classification problem detected. 0.588308940222183 .. GENERATED FROM PYTHON SOURCE LINES 87-88 This did not change much, let's explore other kernels too. .. GENERATED FROM PYTHON SOURCE LINES 88-103 .. code-block:: Python creator = PipelineCreator(problem_type="classification") creator.add("zscore") creator.add("svm", kernel=["linear", "rbf", "poly"], C=[0.01, 0.1]) scores, estimator = run_cross_validation( X=X, y=y, data=df_fmri, model=creator, search_params=search_params, return_estimator="final", ) print(scores["test_score"].mean()) .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-01-16 10:54:16,744 - julearn - INFO - Adding step zscore that applies to ColumnTypes 2026-01-16 10:54:16,744 - julearn - INFO - Step added 2026-01-16 10:54:16,744 - julearn - INFO - Adding step svm that applies to ColumnTypes 2026-01-16 10:54:16,744 - julearn - INFO - Tuning hyperparameter kernel = ['linear', 'rbf', 'poly'] 2026-01-16 10:54:16,745 - julearn - INFO - Tuning hyperparameter C = [0.01, 0.1] 2026-01-16 10:54:16,745 - julearn - INFO - Step added 2026-01-16 10:54:16,745 - julearn - INFO - ==== Input Data ==== 2026-01-16 10:54:16,745 - julearn - INFO - Using dataframe as input 2026-01-16 10:54:16,745 - julearn - INFO - Features: ['frontal', 'parietal'] 2026-01-16 10:54:16,745 - julearn - INFO - Target: event 2026-01-16 10:54:16,745 - julearn - INFO - Expanded features: ['frontal', 'parietal'] 2026-01-16 10:54:16,745 - julearn - INFO - X_types:{} 2026-01-16 10:54:16,745 - julearn - WARNING - The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. /home/runner/work/julearn/julearn/julearn/prepare.py:576: RuntimeWarning: The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. warn_with_log( 2026-01-16 10:54:16,746 - julearn - INFO - ==================== 2026-01-16 10:54:16,746 - julearn - INFO - 2026-01-16 10:54:16,747 - julearn - INFO - = Model Parameters = 2026-01-16 10:54:16,747 - julearn - INFO - Tuning hyperparameters using grid 2026-01-16 10:54:16,747 - julearn - INFO - Hyperparameters: 2026-01-16 10:54:16,747 - julearn - INFO - svm__kernel: ['linear', 'rbf', 'poly'] 2026-01-16 10:54:16,747 - julearn - INFO - svm__C: [0.01, 0.1] 2026-01-16 10:54:16,747 - julearn - INFO - Using inner CV scheme KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:16,748 - julearn - INFO - Search Parameters: 2026-01-16 10:54:16,748 - julearn - INFO - cv: KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:16,748 - julearn - INFO - ==================== 2026-01-16 10:54:16,748 - julearn - INFO - 2026-01-16 10:54:16,748 - julearn - INFO - = Data Information = 2026-01-16 10:54:16,748 - julearn - INFO - Problem type: classification 2026-01-16 10:54:16,748 - julearn - INFO - Number of samples: 532 2026-01-16 10:54:16,748 - julearn - INFO - Number of features: 2 2026-01-16 10:54:16,748 - julearn - INFO - ==================== 2026-01-16 10:54:16,748 - julearn - INFO - 2026-01-16 10:54:16,749 - julearn - INFO - Number of classes: 2 2026-01-16 10:54:16,749 - julearn - INFO - Target type: object 2026-01-16 10:54:16,750 - julearn - INFO - Class distributions: event cue 266 stim 266 Name: count, dtype: int64 2026-01-16 10:54:16,750 - julearn - INFO - Using outer CV scheme KFold(n_splits=5, random_state=None, shuffle=False) (incl. final model) 2026-01-16 10:54:16,750 - julearn - INFO - Binary classification problem detected. 0.7087109857168048 .. GENERATED FROM PYTHON SOURCE LINES 104-105 It seems that we might have found a better model, but which one is it? .. GENERATED FROM PYTHON SOURCE LINES 105-107 .. code-block:: Python print(estimator.best_params_) .. rst-class:: sphx-glr-script-out .. code-block:: none {'svm__C': 0.1, 'svm__kernel': 'rbf'} .. GENERATED FROM PYTHON SOURCE LINES 108-110 Now that we know that a RBF kernel is better, lest test different *gamma* parameters. .. GENERATED FROM PYTHON SOURCE LINES 110-127 .. code-block:: Python creator = PipelineCreator(problem_type="classification") creator.add("zscore") creator.add("svm", kernel="rbf", C=[0.01, 0.1], gamma=[1e-2, 1e-3]) scores, estimator = run_cross_validation( X=X, y=y, data=df_fmri, model=creator, search_params=search_params, return_estimator="final", ) print(scores["test_score"].mean()) print(estimator.best_params_) .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-01-16 10:54:17,534 - julearn - INFO - Adding step zscore that applies to ColumnTypes 2026-01-16 10:54:17,534 - julearn - INFO - Step added 2026-01-16 10:54:17,534 - julearn - INFO - Adding step svm that applies to ColumnTypes 2026-01-16 10:54:17,534 - julearn - INFO - Setting hyperparameter kernel = rbf 2026-01-16 10:54:17,534 - julearn - INFO - Tuning hyperparameter C = [0.01, 0.1] 2026-01-16 10:54:17,534 - julearn - INFO - Tuning hyperparameter gamma = [0.01, 0.001] 2026-01-16 10:54:17,534 - julearn - INFO - Step added 2026-01-16 10:54:17,534 - julearn - INFO - ==== Input Data ==== 2026-01-16 10:54:17,535 - julearn - INFO - Using dataframe as input 2026-01-16 10:54:17,535 - julearn - INFO - Features: ['frontal', 'parietal'] 2026-01-16 10:54:17,535 - julearn - INFO - Target: event 2026-01-16 10:54:17,535 - julearn - INFO - Expanded features: ['frontal', 'parietal'] 2026-01-16 10:54:17,535 - julearn - INFO - X_types:{} 2026-01-16 10:54:17,535 - julearn - WARNING - The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. /home/runner/work/julearn/julearn/julearn/prepare.py:576: RuntimeWarning: The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. warn_with_log( 2026-01-16 10:54:17,536 - julearn - INFO - ==================== 2026-01-16 10:54:17,536 - julearn - INFO - 2026-01-16 10:54:17,537 - julearn - INFO - = Model Parameters = 2026-01-16 10:54:17,537 - julearn - INFO - Tuning hyperparameters using grid 2026-01-16 10:54:17,537 - julearn - INFO - Hyperparameters: 2026-01-16 10:54:17,537 - julearn - INFO - svm__C: [0.01, 0.1] 2026-01-16 10:54:17,537 - julearn - INFO - svm__gamma: [0.01, 0.001] 2026-01-16 10:54:17,537 - julearn - INFO - Using inner CV scheme KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:17,537 - julearn - INFO - Search Parameters: 2026-01-16 10:54:17,537 - julearn - INFO - cv: KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:17,538 - julearn - INFO - ==================== 2026-01-16 10:54:17,538 - julearn - INFO - 2026-01-16 10:54:17,538 - julearn - INFO - = Data Information = 2026-01-16 10:54:17,538 - julearn - INFO - Problem type: classification 2026-01-16 10:54:17,538 - julearn - INFO - Number of samples: 532 2026-01-16 10:54:17,538 - julearn - INFO - Number of features: 2 2026-01-16 10:54:17,538 - julearn - INFO - ==================== 2026-01-16 10:54:17,538 - julearn - INFO - 2026-01-16 10:54:17,539 - julearn - INFO - Number of classes: 2 2026-01-16 10:54:17,539 - julearn - INFO - Target type: object 2026-01-16 10:54:17,539 - julearn - INFO - Class distributions: event cue 266 stim 266 Name: count, dtype: int64 2026-01-16 10:54:17,540 - julearn - INFO - Using outer CV scheme KFold(n_splits=5, random_state=None, shuffle=False) (incl. final model) 2026-01-16 10:54:17,540 - julearn - INFO - Binary classification problem detected. 0.5188855581026275 {'svm__C': 0.01, 'svm__gamma': 0.001} .. GENERATED FROM PYTHON SOURCE LINES 128-130 It seems that without tuning the gamma parameter we had a better accuracy. Let's add the default value and see what happens. .. GENERATED FROM PYTHON SOURCE LINES 130-151 .. code-block:: Python creator = PipelineCreator(problem_type="classification") creator.add("zscore") creator.add("svm", kernel="rbf", C=[0.01, 0.1], gamma=[1e-2, 1e-3, "scale"]) X = ["frontal", "parietal"] y = "event" search_params = {"cv": 2} scores, estimator = run_cross_validation( X=X, y=y, data=df_fmri, model=creator, return_estimator="final", search_params=search_params, ) print(scores["test_score"].mean()) print(estimator.best_params_) .. rst-class:: sphx-glr-script-out .. code-block:: none 2026-01-16 10:54:18,119 - julearn - INFO - Adding step zscore that applies to ColumnTypes 2026-01-16 10:54:18,119 - julearn - INFO - Step added 2026-01-16 10:54:18,119 - julearn - INFO - Adding step svm that applies to ColumnTypes 2026-01-16 10:54:18,120 - julearn - INFO - Setting hyperparameter kernel = rbf 2026-01-16 10:54:18,120 - julearn - INFO - Tuning hyperparameter C = [0.01, 0.1] 2026-01-16 10:54:18,120 - julearn - INFO - Tuning hyperparameter gamma = [0.01, 0.001, 'scale'] 2026-01-16 10:54:18,120 - julearn - INFO - Step added 2026-01-16 10:54:18,120 - julearn - INFO - ==== Input Data ==== 2026-01-16 10:54:18,120 - julearn - INFO - Using dataframe as input 2026-01-16 10:54:18,120 - julearn - INFO - Features: ['frontal', 'parietal'] 2026-01-16 10:54:18,120 - julearn - INFO - Target: event 2026-01-16 10:54:18,120 - julearn - INFO - Expanded features: ['frontal', 'parietal'] 2026-01-16 10:54:18,120 - julearn - INFO - X_types:{} 2026-01-16 10:54:18,121 - julearn - WARNING - The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. /home/runner/work/julearn/julearn/julearn/prepare.py:576: RuntimeWarning: The following columns are not defined in X_types: ['frontal', 'parietal']. They will be treated as continuous. warn_with_log( 2026-01-16 10:54:18,121 - julearn - INFO - ==================== 2026-01-16 10:54:18,121 - julearn - INFO - 2026-01-16 10:54:18,122 - julearn - INFO - = Model Parameters = 2026-01-16 10:54:18,122 - julearn - INFO - Tuning hyperparameters using grid 2026-01-16 10:54:18,122 - julearn - INFO - Hyperparameters: 2026-01-16 10:54:18,122 - julearn - INFO - svm__C: [0.01, 0.1] 2026-01-16 10:54:18,122 - julearn - INFO - svm__gamma: [0.01, 0.001, 'scale'] 2026-01-16 10:54:18,123 - julearn - INFO - Using inner CV scheme KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:18,123 - julearn - INFO - Search Parameters: 2026-01-16 10:54:18,123 - julearn - INFO - cv: KFold(n_splits=2, random_state=None, shuffle=False) 2026-01-16 10:54:18,123 - julearn - INFO - ==================== 2026-01-16 10:54:18,123 - julearn - INFO - 2026-01-16 10:54:18,123 - julearn - INFO - = Data Information = 2026-01-16 10:54:18,123 - julearn - INFO - Problem type: classification 2026-01-16 10:54:18,123 - julearn - INFO - Number of samples: 532 2026-01-16 10:54:18,124 - julearn - INFO - Number of features: 2 2026-01-16 10:54:18,124 - julearn - INFO - ==================== 2026-01-16 10:54:18,124 - julearn - INFO - 2026-01-16 10:54:18,124 - julearn - INFO - Number of classes: 2 2026-01-16 10:54:18,124 - julearn - INFO - Target type: object 2026-01-16 10:54:18,125 - julearn - INFO - Class distributions: event cue 266 stim 266 Name: count, dtype: int64 2026-01-16 10:54:18,125 - julearn - INFO - Using outer CV scheme KFold(n_splits=5, random_state=None, shuffle=False) (incl. final model) 2026-01-16 10:54:18,125 - julearn - INFO - Binary classification problem detected. 0.7087109857168048 {'svm__C': 0.1, 'svm__gamma': 'scale'} .. GENERATED FROM PYTHON SOURCE LINES 152-153 .. code-block:: Python print(estimator.best_estimator_["svm"]._gamma) .. rst-class:: sphx-glr-script-out .. code-block:: none 0.5 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.624 seconds) .. _sphx_glr_download_auto_examples_03_complex_models_run_hyperparameter_tuning.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_hyperparameter_tuning.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_hyperparameter_tuning.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: run_hyperparameter_tuning.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_