MCPcopy
hub / github.com/ContextLab/hypertools / load

Function load

hypertools/tools/load.py:32–148  ·  view source on GitHub ↗

Load a .geo file or example data Parameters ---------- dataset : string The name of the example dataset. Can be a `.geo` file, or one of a number of example datasets listed below. `weights` is list of 2 numpy arrays, each containing average brain a

(
        dataset,
        reduce=None,
        ndims=None,
        align=None,
        normalize=None,
        *,
        legacy=False
)

Source from the content-addressed store, hash-verified

30
31
32def load(
33 dataset,
34 reduce=None,
35 ndims=None,
36 align=None,
37 normalize=None,
38 *,
39 legacy=False
40):
41 """
42 Load a .geo file or example data
43
44 Parameters
45 ----------
46 dataset : string
47 The name of the example dataset. Can be a `.geo` file, or one of a
48 number of example datasets listed below.
49
50 `weights` is list of 2 numpy arrays, each containing average brain
51 activity (fMRI) from 18 subjects listening to the same story, fit using
52 Hierarchical Topographic Factor Analysis (HTFA) with 100 nodes. The rows
53 are fMRI measurements and the columns are parameters of the model.
54
55 `weights_sample` is a sample of 3 subjects from that dataset.
56
57 `weights_avg` is the dataset split in half and averaged into two groups.
58
59 `spiral` is numpy array containing data for a 3D spiral, used to
60 highlight the `procrustes` function.
61
62 `mushrooms` is a numpy array comprised of features (columns) of a
63 collection of 8,124 mushroomm samples (rows).
64
65 `sotus` is a collection of State of the Union speeches from 1989-2018.
66
67 `wiki` is a collection of wikipedia pages used to fit wiki-model.
68
69 `wiki-model` is a sklearn Pipeline (CountVectorizer->LatentDirichletAllocation)
70 trained on a sample of wikipedia articles. It can be used to transform
71 text to topic vectors.
72
73 normalize : str or False or None
74 If set to 'across', the columns of the input data will be z-scored
75 across lists (default). That is, the z-scores will be computed with
76 with respect to column n across all arrays passed in the list. If set
77 to 'within', the columns will be z-scored within each list that is
78 passed. If set to 'row', each row of the input data will be z-scored.
79 If set to False, the input data will be returned with no z-scoring.
80
81 reduce : str or dict
82 Decomposition/manifold learning model to use. Models supported: PCA,
83 IncrementalPCA, SparsePCA, MiniBatchSparsePCA, KernelPCA, FastICA,
84 FactorAnalysis, TruncatedSVD, DictionaryLearning, MiniBatchDictionaryLearning,
85 TSNE, Isomap, SpectralEmbedding, LocallyLinearEmbedding, and MDS. Can be
86 passed as a string, but for finer control of the model parameters, pass
87 as a dictionary, e.g. reduce={'model' : 'PCA', 'params' : {'whiten' : True}}.
88 See scikit-learn specific model docs for details on parameters supported
89 for each model.

Callers 15

test_plot.pyFile · 0.90
test_align.pyFile · 0.90
test_procrustes_funcFunction · 0.90
test_load_weights_avgFunction · 0.90
test_load_weights_sampleFunction · 0.90
test_load_weightsFunction · 0.90
test_load_mushroomsFunction · 0.90
test_load_spiralFunction · 0.90
test_weightsFunction · 0.90
test_weights_ndim3Function · 0.90
test_weights_ndim2Function · 0.90
test_weights_ndim1Function · 0.90

Calls 6

analyzeFunction · 0.90
plotFunction · 0.90
_load_example_dataFunction · 0.85
HypertoolsIOErrorClass · 0.85
_load_legacyFunction · 0.85
get_dataMethod · 0.80

Tested by 13

test_procrustes_funcFunction · 0.72
test_load_weights_avgFunction · 0.72
test_load_weights_sampleFunction · 0.72
test_load_weightsFunction · 0.72
test_load_mushroomsFunction · 0.72
test_load_spiralFunction · 0.72
test_weightsFunction · 0.72
test_weights_ndim3Function · 0.72
test_weights_ndim2Function · 0.72
test_weights_ndim1Function · 0.72
test_weights_ndim3_alignFunction · 0.72
test_weights_ndim2_alignFunction · 0.72