Voxel-Based Morphometry on Oasis dataset#

This example uses Voxel-Based Morphometry (VBM) to study the relationship between aging and gray matter density.

The data come from the OASIS project. If you use it, you need to agree with the data usage agreement available on the website.

It has been run through a standard VBM pipeline (using SPM8 and NewSegment) to create VBM maps, which we study here.

Predictive modeling analysis: VBM bio-markers of aging?#

We run a standard SVM-ANOVA nilearn pipeline to predict age from the VBM data. We use only 100 subjects from the OASIS dataset to limit the memory usage.

Note that for an actual predictive modeling study of aging, the study should be ran on the full set of subjects. Also, all parameters should be set by cross-validation. This includes the smoothing applied to the data and the number of features selected by the ANOVA step. Indeed, even these data-preparation parameter impact significantly the prediction score.

Also, parameters such as the smoothing should be applied to the data and the number of features selected by the ANOVA step should be set by nested cross-validation, as they impact significantly the prediction score.

Brain mapping with mass univariate#

SVM weights are very noisy, partly because heavy smoothing is detrimental for the prediction here. A standard analysis using mass-univariate GLM (here permuted to have exact correction for multiple comparisons) gives a much clearer view of the important regions.


Note

If you are using Nilearn with a version older than 0.9.0, then you should either upgrade your version or import maskers from the input_data module instead of the maskers module.

That is, you should manually replace in the following example all occurrences of:

from nilearn.maskers import NiftiMasker

with:

from nilearn.input_data import NiftiMasker
# Authors: Elvis Dhomatob, <elvis.dohmatob@inria.fr>, Apr. 2014
#          Virgile Fritsch, <virgile.fritsch@inria.fr>, Apr 2014
#          Gael Varoquaux, Apr 2014
#          Andres Hoyos-Idrobo, Apr 2017

import matplotlib.pyplot as plt
import numpy as np
from nilearn import datasets
from nilearn.image import get_data
from nilearn.maskers import NiftiMasker

n_subjects = 100  # more subjects requires more memory

Load Oasis dataset#

oasis_dataset = datasets.fetch_oasis_vbm(
    n_subjects=n_subjects, legacy_format=False
)
gray_matter_map_filenames = oasis_dataset.gray_matter_maps
age = oasis_dataset.ext_vars["age"].values

# Split data into training set and test set
from sklearn.model_selection import train_test_split

gm_imgs_train, gm_imgs_test, age_train, age_test = train_test_split(
    gray_matter_map_filenames, age, train_size=0.6, random_state=0
)

# print basic information on the dataset
print(
    "First gray-matter anatomy image (3D) is located at: "
    f"{oasis_dataset.gray_matter_maps[0]}"
)
print(
    "First white-matter anatomy image (3D) is located at: "
    f"{oasis_dataset.white_matter_maps[0]}"
)
First gray-matter anatomy image (3D) is located at: /home/runner/work/nilearn/nilearn/nilearn_data/oasis1/OAS1_0001_MR1/mwrc1OAS1_0001_MR1_mpr_anon_fslswapdim_bet.nii.gz
First white-matter anatomy image (3D) is located at: /home/runner/work/nilearn/nilearn/nilearn_data/oasis1/OAS1_0001_MR1/mwrc2OAS1_0001_MR1_mpr_anon_fslswapdim_bet.nii.gz

Preprocess data#

nifti_masker = NiftiMasker(
    standardize=False, smoothing_fwhm=2, memory="nilearn_cache"
)  # cache options
gm_maps_masked = nifti_masker.fit_transform(gm_imgs_train)

# The features with too low between-subject variance are removed using
# :class:`sklearn.feature_selection.VarianceThreshold`.
from sklearn.feature_selection import VarianceThreshold

variance_threshold = VarianceThreshold(threshold=0.01)
variance_threshold.fit_transform(gm_maps_masked)

# Then we convert the data back to the mask image in order to use it for
# decoding process
mask = nifti_masker.inverse_transform(variance_threshold.get_support())

Prediction pipeline with ANOVA and SVR using nilearn.decoding.DecoderRegressor Object

# In nilearn we can benefit from the built-in DecoderRegressor object to
# do ANOVA with SVR instead of manually defining the whole pipeline.
# This estimator also uses Cross Validation to select best models and ensemble
# them. Furthermore, you can pass n_jobs=<some_high_value> to the
# DecoderRegressor class to take advantage of a multi-core system.
# To save time (because these are anat images with many voxels), we include
# only the 1-percent voxels most correlated with the age variable to fit. We
# also want to set mask hyperparameter to be the mask we just obtained above.

from nilearn.decoding import DecoderRegressor

decoder = DecoderRegressor(
    estimator="svr",
    mask=mask,
    scoring="neg_mean_absolute_error",
    screening_percentile=1,
    n_jobs=1,
)
# Fit and predict with the decoder
decoder.fit(gm_imgs_train, age_train)

# Sort test data for better visualization (trend, etc.)
perm = np.argsort(age_test)[::-1]
age_test = age_test[perm]
gm_imgs_test = np.array(gm_imgs_test)[perm]
age_pred = decoder.predict(gm_imgs_test)

prediction_score = -np.mean(decoder.cv_scores_["beta"])

print("=== DECODER ===")
print(f"explained variance for the cross-validation: {prediction_score:f}")
print()
/usr/share/miniconda3/envs/testenv/lib/python3.9/site-packages/joblib/memory.py:349: FutureWarning:

The default strategy for standardize is currently 'zscore' which incorrectly uses population std to calculate sample zscores. The new strategy 'zscore_sample' corrects this behavior by using the sample std. In release 0.13, the default strategy will be replaced by the new strategy and the 'zscore' option will be removed. Please use 'zscore_sample' instead.

/usr/share/miniconda3/envs/testenv/lib/python3.9/site-packages/joblib/memory.py:349: FutureWarning:

The default strategy for standardize is currently 'zscore' which incorrectly uses population std to calculate sample zscores. The new strategy 'zscore_sample' corrects this behavior by using the sample std. In release 0.13, the default strategy will be replaced by the new strategy and the 'zscore' option will be removed. Please use 'zscore_sample' instead.

=== DECODER ===
explained variance for the cross-validation: 10.670598

Visualization#

weight_img = decoder.coef_img_["beta"]

# Create the figure
from nilearn.plotting import plot_stat_map, show

bg_filename = gray_matter_map_filenames[0]
z_slice = 0
display = plot_stat_map(
    weight_img, bg_img=bg_filename, display_mode="z", cut_coords=[z_slice]
)
display.title("SVM weights")
show()
plot oasis vbm

Visualize the quality of predictions#

plt.figure(figsize=(6, 4.5))
plt.suptitle(f"Decoder: Mean Absolute Error {prediction_score:.2f} years")
linewidth = 3
plt.plot(age_test, label="True age", linewidth=linewidth)
plt.plot(age_pred, "--", c="g", label="Predicted age", linewidth=linewidth)
plt.ylabel("age")
plt.xlabel("subject")
plt.legend(loc="best")
plt.figure(figsize=(6, 4.5))
plt.plot(
    age_test - age_pred, label="True age - predicted age", linewidth=linewidth
)
plt.xlabel("subject")
plt.legend(loc="best")
  • Decoder: Mean Absolute Error 10.67 years
  • plot oasis vbm
<matplotlib.legend.Legend object at 0x7f31701d0760>

Inference with massively univariate model#

print("Massively univariate model")

gm_maps_masked = NiftiMasker().fit_transform(gray_matter_map_filenames)
data = variance_threshold.fit_transform(gm_maps_masked)

# Statistical inference
from nilearn.mass_univariate import permuted_ols

# This can be changed to use more CPUs.
neg_log_pvals, t_scores_original_data, _ = permuted_ols(
    age,
    data,  # + intercept as a covariate by default
    n_perm=2000,  # 1,000 in the interest of time; 10000 would be better
    verbose=1,  # display progress bar
    n_jobs=1,
)
signed_neg_log_pvals = neg_log_pvals * np.sign(t_scores_original_data)
signed_neg_log_pvals_unmasked = nifti_masker.inverse_transform(
    variance_threshold.inverse_transform(signed_neg_log_pvals)
)

# Show results
threshold = -np.log10(0.1)  # 10% corrected

fig = plt.figure(figsize=(5.5, 7.5), facecolor="k")

display = plot_stat_map(
    signed_neg_log_pvals_unmasked,
    bg_img=bg_filename,
    threshold=threshold,
    cmap=plt.cm.RdBu_r,
    display_mode="z",
    cut_coords=[z_slice],
    figure=fig,
)
title = (
    "Negative $\\log_{10}$ p-values" "\n(Non-parametric + max-type correction)"
)
display.title(title, y=1.2)

n_detections = (get_data(signed_neg_log_pvals_unmasked) > threshold).sum()
print(f"\n{int(n_detections)} detections")

show()
plot oasis vbm
Massively univariate model
[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
Job #1, processed 0/2000 permutations (0.00%, 189.3472671508789 seconds remaining)
Job #1, processed 10/2000 permutations (0.50%, 34.63962173461914 seconds remaining)
Job #1, processed 20/2000 permutations (1.00%, 32.3176167011261 seconds remaining)
Job #1, processed 30/2000 permutations (1.50%, 31.300877730051678 seconds remaining)
Job #1, processed 40/2000 permutations (2.00%, 30.66573691368103 seconds remaining)
Job #1, processed 50/2000 permutations (2.50%, 30.29219341278076 seconds remaining)
Job #1, processed 60/2000 permutations (3.00%, 30.070271968841556 seconds remaining)
Job #1, processed 70/2000 permutations (3.50%, 29.842816999980382 seconds remaining)
Job #1, processed 80/2000 permutations (4.00%, 29.701303482055664 seconds remaining)
Job #1, processed 90/2000 permutations (4.50%, 29.551310353808933 seconds remaining)
Job #1, processed 100/2000 permutations (5.00%, 29.46725368499756 seconds remaining)
Job #1, processed 110/2000 permutations (5.50%, 29.31736948273399 seconds remaining)
Job #1, processed 120/2000 permutations (6.00%, 29.14975849787394 seconds remaining)
Job #1, processed 130/2000 permutations (6.50%, 28.935883356974674 seconds remaining)
Job #1, processed 140/2000 permutations (7.00%, 28.737175634929113 seconds remaining)
Job #1, processed 150/2000 permutations (7.50%, 28.53607980410258 seconds remaining)
Job #1, processed 160/2000 permutations (8.00%, 28.363571524620056 seconds remaining)
Job #1, processed 170/2000 permutations (8.50%, 28.201929246678073 seconds remaining)
Job #1, processed 180/2000 permutations (9.00%, 28.026884608798557 seconds remaining)
Job #1, processed 190/2000 permutations (9.50%, 27.860655257576393 seconds remaining)
Job #1, processed 200/2000 permutations (10.00%, 27.687357902526855 seconds remaining)
Job #1, processed 210/2000 permutations (10.50%, 27.519122169131325 seconds remaining)
Job #1, processed 220/2000 permutations (11.00%, 27.329202565279875 seconds remaining)
Job #1, processed 230/2000 permutations (11.50%, 27.126655402390856 seconds remaining)
Job #1, processed 240/2000 permutations (12.00%, 26.988298416137695 seconds remaining)
Job #1, processed 250/2000 permutations (12.50%, 26.913745164871216 seconds remaining)
Job #1, processed 260/2000 permutations (13.00%, 26.82328231518085 seconds remaining)
Job #1, processed 270/2000 permutations (13.50%, 26.696978365933454 seconds remaining)
Job #1, processed 280/2000 permutations (14.00%, 26.557579074587142 seconds remaining)
Job #1, processed 290/2000 permutations (14.50%, 26.437099703427016 seconds remaining)
Job #1, processed 300/2000 permutations (15.00%, 26.315759817759197 seconds remaining)
Job #1, processed 310/2000 permutations (15.50%, 26.170537471771237 seconds remaining)
Job #1, processed 320/2000 permutations (16.00%, 25.99395525455475 seconds remaining)
Job #1, processed 330/2000 permutations (16.50%, 26.116332856091585 seconds remaining)
Job #1, processed 340/2000 permutations (17.00%, 25.914687072529514 seconds remaining)
Job #1, processed 350/2000 permutations (17.50%, 25.72999906539917 seconds remaining)
Job #1, processed 360/2000 permutations (18.00%, 25.58609702852037 seconds remaining)
Job #1, processed 370/2000 permutations (18.50%, 25.39610809248847 seconds remaining)
Job #1, processed 380/2000 permutations (19.00%, 25.206876077150046 seconds remaining)
Job #1, processed 390/2000 permutations (19.50%, 25.029482737565655 seconds remaining)
Job #1, processed 400/2000 permutations (20.00%, 24.850961685180664 seconds remaining)
Job #1, processed 410/2000 permutations (20.50%, 24.679809372599532 seconds remaining)
Job #1, processed 420/2000 permutations (21.00%, 24.509902352378482 seconds remaining)
Job #1, processed 430/2000 permutations (21.50%, 24.341000251991805 seconds remaining)
Job #1, processed 440/2000 permutations (22.00%, 24.17264816977761 seconds remaining)
Job #1, processed 450/2000 permutations (22.50%, 24.008056269751656 seconds remaining)
Job #1, processed 460/2000 permutations (23.00%, 23.84369144232377 seconds remaining)
Job #1, processed 470/2000 permutations (23.50%, 23.686527226833586 seconds remaining)
Job #1, processed 480/2000 permutations (24.00%, 23.523029724756874 seconds remaining)
Job #1, processed 490/2000 permutations (24.50%, 23.35552488054548 seconds remaining)
Job #1, processed 500/2000 permutations (25.00%, 23.1930148601532 seconds remaining)
Job #1, processed 510/2000 permutations (25.50%, 23.02717414556765 seconds remaining)
Job #1, processed 520/2000 permutations (26.00%, 22.857070390994732 seconds remaining)
Job #1, processed 530/2000 permutations (26.50%, 22.689312727946156 seconds remaining)
Job #1, processed 540/2000 permutations (27.00%, 22.518098062939114 seconds remaining)
Job #1, processed 550/2000 permutations (27.50%, 22.34951428933577 seconds remaining)
Job #1, processed 560/2000 permutations (28.00%, 22.187004906790598 seconds remaining)
Job #1, processed 570/2000 permutations (28.50%, 22.01951682358457 seconds remaining)
Job #1, processed 580/2000 permutations (29.00%, 21.854484484113495 seconds remaining)
Job #1, processed 590/2000 permutations (29.50%, 21.688548985174144 seconds remaining)
Job #1, processed 600/2000 permutations (30.00%, 21.52072286605835 seconds remaining)
Job #1, processed 610/2000 permutations (30.50%, 21.35298017595635 seconds remaining)
Job #1, processed 620/2000 permutations (31.00%, 21.1911409747216 seconds remaining)
Job #1, processed 630/2000 permutations (31.50%, 21.033746840461852 seconds remaining)
Job #1, processed 640/2000 permutations (32.00%, 20.878287732601166 seconds remaining)
Job #1, processed 650/2000 permutations (32.50%, 20.726486096015346 seconds remaining)
Job #1, processed 660/2000 permutations (33.00%, 20.566244320435956 seconds remaining)
Job #1, processed 670/2000 permutations (33.50%, 20.40080020676798 seconds remaining)
Job #1, processed 680/2000 permutations (34.00%, 20.237537510254803 seconds remaining)
Job #1, processed 690/2000 permutations (34.50%, 20.07632030611453 seconds remaining)
Job #1, processed 700/2000 permutations (35.00%, 19.915259190968104 seconds remaining)
Job #1, processed 710/2000 permutations (35.50%, 19.756369627697367 seconds remaining)
Job #1, processed 720/2000 permutations (36.00%, 19.591746860080296 seconds remaining)
Job #1, processed 730/2000 permutations (36.50%, 19.428120420403676 seconds remaining)
Job #1, processed 740/2000 permutations (37.00%, 19.26552704862646 seconds remaining)
Job #1, processed 750/2000 permutations (37.50%, 19.1051717599233 seconds remaining)
Job #1, processed 760/2000 permutations (38.00%, 18.957435143621343 seconds remaining)
Job #1, processed 770/2000 permutations (38.50%, 18.795665892687712 seconds remaining)
Job #1, processed 780/2000 permutations (39.00%, 18.63616974537189 seconds remaining)
Job #1, processed 790/2000 permutations (39.50%, 18.479247283331954 seconds remaining)
Job #1, processed 800/2000 permutations (40.00%, 18.32872474193573 seconds remaining)
Job #1, processed 810/2000 permutations (40.50%, 18.178434324853214 seconds remaining)
Job #1, processed 820/2000 permutations (41.00%, 18.019515328290986 seconds remaining)
Job #1, processed 830/2000 permutations (41.50%, 17.862369999828108 seconds remaining)
Job #1, processed 840/2000 permutations (42.00%, 17.703070606504166 seconds remaining)
Job #1, processed 850/2000 permutations (42.50%, 17.54652134109946 seconds remaining)
Job #1, processed 860/2000 permutations (43.00%, 17.394713917443916 seconds remaining)
Job #1, processed 870/2000 permutations (43.50%, 17.239344539313482 seconds remaining)
Job #1, processed 880/2000 permutations (44.00%, 17.08288370479237 seconds remaining)
Job #1, processed 890/2000 permutations (44.50%, 16.9259005235822 seconds remaining)
Job #1, processed 900/2000 permutations (45.00%, 16.770956993103027 seconds remaining)
Job #1, processed 910/2000 permutations (45.50%, 16.617679506867795 seconds remaining)
Job #1, processed 920/2000 permutations (46.00%, 16.464609146118164 seconds remaining)
Job #1, processed 930/2000 permutations (46.50%, 16.31189544995626 seconds remaining)
Job #1, processed 940/2000 permutations (47.00%, 16.154260092593255 seconds remaining)
Job #1, processed 950/2000 permutations (47.50%, 15.999285974000632 seconds remaining)
Job #1, processed 960/2000 permutations (48.00%, 15.845554133256275 seconds remaining)
Job #1, processed 970/2000 permutations (48.50%, 15.692387268715297 seconds remaining)
Job #1, processed 980/2000 permutations (49.00%, 15.54066157827572 seconds remaining)
Job #1, processed 990/2000 permutations (49.50%, 15.388122216619625 seconds remaining)
Job #1, processed 1000/2000 permutations (50.00%, 15.234766244888306 seconds remaining)
Job #1, processed 1010/2000 permutations (50.50%, 15.084068390402463 seconds remaining)
Job #1, processed 1020/2000 permutations (51.00%, 14.9336437477785 seconds remaining)
Job #1, processed 1030/2000 permutations (51.50%, 14.7806086424485 seconds remaining)
Job #1, processed 1040/2000 permutations (52.00%, 14.625752228956957 seconds remaining)
Job #1, processed 1050/2000 permutations (52.50%, 14.47406226112729 seconds remaining)
Job #1, processed 1060/2000 permutations (53.00%, 14.322263344278875 seconds remaining)
Job #1, processed 1070/2000 permutations (53.50%, 14.16851913594754 seconds remaining)
Job #1, processed 1080/2000 permutations (54.00%, 14.015218399189136 seconds remaining)
Job #1, processed 1090/2000 permutations (54.50%, 13.862838570131075 seconds remaining)
Job #1, processed 1100/2000 permutations (55.00%, 13.710797634991733 seconds remaining)
Job #1, processed 1110/2000 permutations (55.50%, 13.557783786241 seconds remaining)
Job #1, processed 1120/2000 permutations (56.00%, 13.40278891154698 seconds remaining)
Job #1, processed 1130/2000 permutations (56.50%, 13.249861295244335 seconds remaining)
Job #1, processed 1140/2000 permutations (57.00%, 13.098266572283025 seconds remaining)
Job #1, processed 1150/2000 permutations (57.50%, 12.943684660870096 seconds remaining)
Job #1, processed 1160/2000 permutations (58.00%, 12.792027391236404 seconds remaining)
Job #1, processed 1170/2000 permutations (58.50%, 12.63758015836406 seconds remaining)
Job #1, processed 1180/2000 permutations (59.00%, 12.486090284282879 seconds remaining)
Job #1, processed 1190/2000 permutations (59.50%, 12.332729503888043 seconds remaining)
Job #1, processed 1200/2000 permutations (60.00%, 12.181782722473145 seconds remaining)
Job #1, processed 1210/2000 permutations (60.50%, 12.030806750305429 seconds remaining)
Job #1, processed 1220/2000 permutations (61.00%, 11.879446201637144 seconds remaining)
Job #1, processed 1230/2000 permutations (61.50%, 11.727032477293557 seconds remaining)
Job #1, processed 1240/2000 permutations (62.00%, 11.575300355111398 seconds remaining)
Job #1, processed 1250/2000 permutations (62.50%, 11.423315334320067 seconds remaining)
Job #1, processed 1260/2000 permutations (63.00%, 11.272302608641368 seconds remaining)
Job #1, processed 1270/2000 permutations (63.50%, 11.119258048966175 seconds remaining)
Job #1, processed 1280/2000 permutations (64.00%, 10.966539725661278 seconds remaining)
Job #1, processed 1290/2000 permutations (64.50%, 10.812617196593173 seconds remaining)
Job #1, processed 1300/2000 permutations (65.00%, 10.65823035973769 seconds remaining)
Job #1, processed 1310/2000 permutations (65.50%, 10.504189771550301 seconds remaining)
Job #1, processed 1320/2000 permutations (66.00%, 10.357371901020858 seconds remaining)
Job #1, processed 1330/2000 permutations (66.50%, 10.20220168371846 seconds remaining)
Job #1, processed 1340/2000 permutations (67.00%, 10.047810209331228 seconds remaining)
Job #1, processed 1350/2000 permutations (67.50%, 9.892664079312924 seconds remaining)
Job #1, processed 1360/2000 permutations (68.00%, 9.738622665405273 seconds remaining)
Job #1, processed 1370/2000 permutations (68.50%, 9.585989478730808 seconds remaining)
Job #1, processed 1380/2000 permutations (69.00%, 9.433498935423035 seconds remaining)
Job #1, processed 1390/2000 permutations (69.50%, 9.280225999063726 seconds remaining)
Job #1, processed 1400/2000 permutations (70.00%, 9.128289597375051 seconds remaining)
Job #1, processed 1410/2000 permutations (70.50%, 8.976884532482066 seconds remaining)
Job #1, processed 1420/2000 permutations (71.00%, 8.82516059741168 seconds remaining)
Job #1, processed 1430/2000 permutations (71.50%, 8.672937399857528 seconds remaining)
Job #1, processed 1440/2000 permutations (72.00%, 8.52082363764445 seconds remaining)
Job #1, processed 1450/2000 permutations (72.50%, 8.36879981797317 seconds remaining)
Job #1, processed 1460/2000 permutations (73.00%, 8.217049314551158 seconds remaining)
Job #1, processed 1470/2000 permutations (73.50%, 8.064454073808632 seconds remaining)
Job #1, processed 1480/2000 permutations (74.00%, 7.911897227570818 seconds remaining)
Job #1, processed 1490/2000 permutations (74.50%, 7.7595306354881135 seconds remaining)
Job #1, processed 1500/2000 permutations (75.00%, 7.606648921966553 seconds remaining)
Job #1, processed 1510/2000 permutations (75.50%, 7.454455677247205 seconds remaining)
Job #1, processed 1520/2000 permutations (76.00%, 7.303455930007131 seconds remaining)
Job #1, processed 1530/2000 permutations (76.50%, 7.152031624239255 seconds remaining)
Job #1, processed 1540/2000 permutations (77.00%, 7.000466077358691 seconds remaining)
Job #1, processed 1550/2000 permutations (77.50%, 6.848938557409472 seconds remaining)
Job #1, processed 1560/2000 permutations (78.00%, 6.699176904482719 seconds remaining)
Job #1, processed 1570/2000 permutations (78.50%, 6.548255862703749 seconds remaining)
Job #1, processed 1580/2000 permutations (79.00%, 6.396833489212808 seconds remaining)
Job #1, processed 1590/2000 permutations (79.50%, 6.245055615527075 seconds remaining)
Job #1, processed 1600/2000 permutations (80.00%, 6.093391180038452 seconds remaining)
Job #1, processed 1610/2000 permutations (80.50%, 5.941680694959179 seconds remaining)
Job #1, processed 1620/2000 permutations (81.00%, 5.790247893627779 seconds remaining)
Job #1, processed 1630/2000 permutations (81.50%, 5.63837037057233 seconds remaining)
Job #1, processed 1640/2000 permutations (82.00%, 5.486743141965168 seconds remaining)
Job #1, processed 1650/2000 permutations (82.50%, 5.334837581172134 seconds remaining)
Job #1, processed 1660/2000 permutations (83.00%, 5.1829598783010455 seconds remaining)
Job #1, processed 1670/2000 permutations (83.50%, 5.030864337247289 seconds remaining)
Job #1, processed 1680/2000 permutations (84.00%, 4.878806522914341 seconds remaining)
Job #1, processed 1690/2000 permutations (84.50%, 4.727067525570209 seconds remaining)
Job #1, processed 1700/2000 permutations (85.00%, 4.575352738885319 seconds remaining)
Job #1, processed 1710/2000 permutations (85.50%, 4.423267851098936 seconds remaining)
Job #1, processed 1720/2000 permutations (86.00%, 4.271058881005576 seconds remaining)
Job #1, processed 1730/2000 permutations (86.50%, 4.119008885642697 seconds remaining)
Job #1, processed 1740/2000 permutations (87.00%, 3.9675168662235656 seconds remaining)
Job #1, processed 1750/2000 permutations (87.50%, 3.8151563576289584 seconds remaining)
Job #1, processed 1760/2000 permutations (88.00%, 3.662752812558954 seconds remaining)
Job #1, processed 1770/2000 permutations (88.50%, 3.510799634254585 seconds remaining)
Job #1, processed 1780/2000 permutations (89.00%, 3.358654316891445 seconds remaining)
Job #1, processed 1790/2000 permutations (89.50%, 3.2069911903509216 seconds remaining)
Job #1, processed 1800/2000 permutations (90.00%, 3.054772059122721 seconds remaining)
Job #1, processed 1810/2000 permutations (90.50%, 2.902282775436317 seconds remaining)
Job #1, processed 1820/2000 permutations (91.00%, 2.7502342213641153 seconds remaining)
Job #1, processed 1830/2000 permutations (91.50%, 2.5974744825415272 seconds remaining)
Job #1, processed 1840/2000 permutations (92.00%, 2.444852517998737 seconds remaining)
Job #1, processed 1850/2000 permutations (92.50%, 2.2922940963023417 seconds remaining)
Job #1, processed 1860/2000 permutations (93.00%, 2.139606750139626 seconds remaining)
Job #1, processed 1870/2000 permutations (93.50%, 1.9867290749269373 seconds remaining)
Job #1, processed 1880/2000 permutations (94.00%, 1.8339108558411292 seconds remaining)
Job #1, processed 1890/2000 permutations (94.50%, 1.6810751503737513 seconds remaining)
Job #1, processed 1900/2000 permutations (95.00%, 1.5282960816433555 seconds remaining)
Job #1, processed 1910/2000 permutations (95.50%, 1.375737628387531 seconds remaining)
Job #1, processed 1920/2000 permutations (96.00%, 1.223077525695165 seconds remaining)
Job #1, processed 1930/2000 permutations (96.50%, 1.0702505309347043 seconds remaining)
Job #1, processed 1940/2000 permutations (97.00%, 0.9176428416340622 seconds remaining)
Job #1, processed 1950/2000 permutations (97.50%, 0.7652631600697835 seconds remaining)
Job #1, processed 1960/2000 permutations (98.00%, 0.6125874568004996 seconds remaining)
Job #1, processed 1970/2000 permutations (98.50%, 0.4597371822686365 seconds remaining)
Job #1, processed 1980/2000 permutations (99.00%, 0.30667854800368805 seconds remaining)
Job #1, processed 1990/2000 permutations (99.50%, 0.1533990589218523 seconds remaining)
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:   30.7s finished

1979 detections

Total running time of the script: ( 1 minutes 14.463 seconds)

Estimated memory usage: 1901 MB

Gallery generated by Sphinx-Gallery