Skip to content

Commit cad43e1

Browse files
mvdocTomDLT
authored andcommitted
DOC changes to example 02 3T
- fix some typos - add some style changes - highlight that only for this dataset the optimal delays are 1-4 (since it covers mostly visual cortex)
1 parent 183bc39 commit cad43e1

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

tutorials/movies_3T/02_plot_wordnet_model.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
# Plot the model performances
258258
# ---------------------------
259259
#
260-
# To visualize the model performances, we can plot them on a flatten
260+
# To visualize the model performances, we can plot them on a flattened
261261
# surface of the brain, using a mapper that is specific to the subject brain.
262262
# (Check previous example to see how to use the mapper to Freesurfer average
263263
# surface.)
@@ -271,7 +271,7 @@
271271
###############################################################################
272272
# We can see that the "wordnet" features successfully predict a part of the
273273
# brain activity, with :math:`R^2` scores as high as 0.4. Note that these
274-
# scores are generalization scores, since they aere computed on a test set not
274+
# scores are generalization scores, since they are computed on a test set not
275275
# seen during the mode fitting. Since we fitted a model independently on each
276276
# voxel, we can show the generalization performances at the maximal resolution,
277277
# the voxel.
@@ -289,10 +289,10 @@
289289
# the solver over cross-validation. This plot is helpful to refine the alpha
290290
# grid if the range is too small or too large.
291291
#
292-
# Note that some voxels are at the maximum regularization of the grid. These
293-
# are voxels where the model has no predictive power, and where the optimal
294-
# regularization is large to lead to a prediction equal to zero.
295-
# We do not need to extend the alpha range for these voxels.
292+
# Note that some voxels might be at the maximum regularization value in the grid
293+
# search. These are voxels where the model has no predictive power, thus
294+
# the optimal regularization parameter is large to lead to a prediction equal
295+
# to zero. We do not need to extend the alpha range for these voxels.
296296

297297
from himalaya.viz import plot_alphas_diagnostic
298298
best_alphas = backend.to_numpy(pipeline[-1].best_alphas_)
@@ -304,9 +304,9 @@
304304
# -----------------------------------
305305
#
306306
# To present an example of model comparison, we define here another model,
307-
# without feature delays (i.e. no ``Delayer``). This model is unlikely to
308-
# perform well, since fMRI responses are delayed in time with respect to
309-
# the stimulus.
307+
# without feature delays (i.e. no ``Delayer``). Because the BOLD signal is
308+
# inherently slow due to the dynamics of neuro-vascular coupling, this model
309+
# is unlikely to perform well.
310310

311311
pipeline_nodelay = make_pipeline(
312312
StandardScaler(with_mean=True, with_std=False),
@@ -351,12 +351,12 @@
351351
# Visualize the HRF
352352
# -----------------
353353
#
354-
# We just saw that delays are necessary to model the BOLD response in such
355-
# fMRI recordings. Here we show how to visualize the hemodynamic response
356-
# function (HRF), as captured in the ridge regression weights.
354+
# We just saw that delays are necessary to model BOLD responses.
355+
# Here we show how the fitted ridge regression weights follow the hemodynamic response
356+
# function (HRF).
357357
#
358358
# Fitting a kernel ridge regression results in a set of coefficients called the
359-
# "dual" coefficients :math:`w`. These coefficients are different from the
359+
# "dual" coefficients :math:`w`. These coefficients differ from the
360360
# "primal" coefficients :math:`\beta` obtained with a ridge regression,
361361
# but the primal coefficients can be computed from the dual coefficients
362362
# using the training features :math:`X`:
@@ -410,7 +410,7 @@
410410
# In this dataset, the brain responses are recorded every two seconds.
411411
#
412412
# We see that the hemodynamic response function (HRF) is captured in the model
413-
# weights. In practice, we can limit the number of features by using only
413+
# weights. In this dataset, we can limit the number of features by using only
414414
# the most informative delays, for example [1, 2, 3, 4].
415415

416416
###############################################################################

0 commit comments

Comments
 (0)