- 记录人:陈亦新
#导入库函数
from nilearn import datasets
from nilearn.decomposition import DictLearning
from nilearn import plotting
#下载数据集
rest_dataset = datasets.fetch_development_fmri(n_subjects = 20)
# 构建字典分化的实例
dict_learn = DictLearning(n_components=8,smoothing_fwhm=6.,
memory="nilearn_cache",memory_level=2,
random_state=0)
dict_learn.fit(rest_dataset["func"])
# 可视化字典分化的成果
plotting.plot_prob_atlas(dict_learn.components_img_,view_type="filled_contours",
title="Dictionary Learning maps")

能够看到,这个脑部的数据下载下来都是nii.gz的数据,是3D的数据。可视化图中似乎是将将脑部的数据划分成不同的区域。假如咱们将n_components调整为2,那么可视化的成果为:

我大胆的猜想,字典分化是一个类似于分类的作用,也能够理解为降维的作用。将脑部区域分成n个部分。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。