.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_age_regression.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_plot_age_regression.py: ====================================== Predict age from white matter features ====================================== Predict subject age from white matter features. This example fetches the Weston-Havens dataset described in Yeatman et al [1]_. This dataset contains tractometry features from 77 subjects ages 6-50. The plots display the absolute value of the mean regression coefficients (averaged across cross-validation splits) for the mean diffusivity (MD) features. Predictive performance for this example is quite poor. In a research setting, one might have to ensemble a number of SGL estimators together and conduct a more thorough search of the hyperparameter space. For more details, please see [2]_. .. [1] Jason D. Yeatman, Brian A. Wandell, & Aviv A. Mezer, "Lifespan maturation and degeneration of human brain white matter" Nature Communications, vol. 5:1, pp. 4932, 2014 DOI: 10.1038/ncomms5932 .. [2] Adam Richie-Halford, Jason Yeatman, Noah Simon, and Ariel Rokem "Multidimensional analysis and detection of informative features in human brain white matter" PLOS Computational Biology, 2021 DOI: 10.1371/journal.pcbi.1009136 .. GENERATED FROM PYTHON SOURCE LINES 27-37 .. code-block:: Python import os.path as op import matplotlib.pyplot as plt import numpy as np from sklearn.model_selection import cross_validate from afqinsight import make_afq_regressor_pipeline from afqinsight.datasets import download_weston_havens, load_afq_data .. GENERATED FROM PYTHON SOURCE LINES 38-50 Fetch example data ------------------ The :func:`download_weston_havens` function download the data used in this example and places it in the `~/.cache/afq-insight/weston_havens` directory. If the directory does not exist, it is created. The data follows the format expected by the :func:`load_afq_data` function: a file called `nodes.csv` that contains AFQ tract profiles and a file called `subjects.csv` that contains information about the subjects. The two files are linked through the `subjectID` column that should exist in both of them. For more information about this format, see also the `AFQ-Browser documentation `_ (items 2 and 3). .. GENERATED FROM PYTHON SOURCE LINES 50-53 .. code-block:: Python workdir = download_weston_havens() .. rst-class:: sphx-glr-script-out .. code-block:: none subjects.csv: 0%| | 0.00/938 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_age_regression.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_age_regression.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_