|
27 | 27 | "# Setup Google Colab\n",
|
28 | 28 | "\n",
|
29 | 29 | "In this script, we setup a Google Colab environment. This script will only work\n",
|
30 |
| - "when run from `Google Colab <https://colab.research.google.com/>`_). You can\n", |
| 30 | + "when run from [Google Colab](https://colab.research.google.com/)). You can\n", |
31 | 31 | "skip it if you run the tutorials on your machine.\n"
|
32 | 32 | ]
|
33 | 33 | },
|
|
458 | 458 | "## Map to subject flatmap\n",
|
459 | 459 | "\n",
|
460 | 460 | "To better understand the distribution of explainable variance, we map the\n",
|
461 |
| - "values to the subject brain. This can be done with `pycortex\n", |
462 |
| - "<https://gallantlab.github.io/pycortex/>`_, which can create interactive 3D\n", |
| 461 | + "values to the subject brain. This can be done with [pycortex](https://gallantlab.github.io/pycortex/), which can create interactive 3D\n", |
463 | 462 | "viewers to be displayed in any modern browser. ``pycortex`` can also display\n",
|
464 | 463 | "flattened maps of the cortical surface to visualize the entire cortical\n",
|
465 | 464 | "surface at once.\n",
|
|
498 | 497 | "source": [
|
499 | 498 | "This figure is a flattened map of the cortical surface. A number of regions\n",
|
500 | 499 | "of interest (ROIs) have been labeled to ease interpretation. If you have\n",
|
501 |
| - "never seen such a flatmap, we recommend taking a look at a `pycortex brain\n", |
502 |
| - "viewer <https://www.gallantlab.org/brainviewer/Deniz2019>`_, which displays\n", |
| 500 | + "never seen such a flatmap, we recommend taking a look at a [pycortex brain\n", |
| 501 | + "viewer](https://www.gallantlab.org/brainviewer/Deniz2019), which displays\n", |
503 | 502 | "the brain in 3D. In this viewer, press \"I\" to inflate the brain, \"F\" to\n",
|
504 | 503 | "flatten the surface, and \"R\" to reset the view (or use the ``surface/unfold``\n",
|
505 | 504 | "cursor on the right menu). Press \"H\" for a list of all keyboard shortcuts.\n",
|
|
2737 | 2736 | "When these delayed features are used to fit a voxelwise encoding model, the\n",
|
2738 | 2737 | "brain response $y$ at time $t$ is simultaneously modeled by the\n",
|
2739 | 2738 | "feature $x$ at times $t-0, t-2, t-4, t-6, t-8$. In the remaining\n",
|
2740 |
| - "of this example we will see that this method improves model prediction accuracy\n", |
2741 |
| - "and it allows to account for the underlying shape of the hemodynamic response\n", |
2742 |
| - "function.\n", |
| 2739 | + "of this example we will see that this method improves model prediction\n", |
| 2740 | + "accuracy and it allows to account for the underlying shape of the hemodynamic\n", |
| 2741 | + "response function.\n", |
2743 | 2742 | "\n"
|
2744 | 2743 | ]
|
2745 | 2744 | },
|
|
2780 | 2779 | "Because the BOLD signal is inherently slow due to the dynamics of\n",
|
2781 | 2780 | "neuro-vascular coupling, this model is unlikely to perform well.\n",
|
2782 | 2781 | "\n",
|
2783 |
| - "Note that if we remove the feature delays, we will have more fMRI samples (3600) than\n", |
2784 |
| - "number of features (1705). In this case, running a kernel version of ridge regression\n", |
2785 |
| - "is computationally suboptimal. Thus, to create a model without delays we are using\n", |
2786 |
| - "`RidgeCV` instead of `KernelRidgeCV`.\n", |
| 2782 | + "Note that if we remove the feature delays, we will have more fMRI samples\n", |
| 2783 | + "(3600) than number of features (1705). In this case, running a kernel version\n", |
| 2784 | + "of ridge regression is computationally suboptimal. Thus, to create a model\n", |
| 2785 | + "without delays we are using `RidgeCV` instead of `KernelRidgeCV`.\n", |
2787 | 2786 | "\n"
|
2788 | 2787 | ]
|
2789 | 2788 | },
|
|
2798 | 2797 | "pipeline_no_delay = make_pipeline(\n",
|
2799 | 2798 | " StandardScaler(with_mean=True, with_std=False),\n",
|
2800 | 2799 | " RidgeCV(\n",
|
2801 |
| - " alphas=alphas, cv=cv,\n", |
| 2800 | + " alphas=alphas, cv=cv, solver=\"svd\",\n", |
2802 | 2801 | " solver_params=dict(n_targets_batch=500, n_alphas_batch=5,\n",
|
2803 | 2802 | " n_targets_batch_refit=100)),\n",
|
2804 | 2803 | ")\n",
|
|
4288 | 4287 | "name": "python",
|
4289 | 4288 | "nbconvert_exporter": "python",
|
4290 | 4289 | "pygments_lexer": "ipython3",
|
4291 |
| - "version": "3.8.3" |
| 4290 | + "version": "3.10.9" |
4292 | 4291 | },
|
4293 | 4292 | "name": "_merged"
|
4294 | 4293 | },
|
|
0 commit comments