{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Analyze data and then plot\n\nThis example demonstrates how to use the `analyze` function to process data\nprior to plotting. The data is a list of numpy arrays representing\nmulti-voxel activity patterns (columns) over time (rows). First, analyze function\nnormalizes the columns of each matrix (within each matrix). Then the data is\nreduced using PCA (10 dims) and finally it is aligned with hyperalignment. We can\nthen plot the data with hyp.plot, which further reduces it so that it can be\nvisualized.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# sphinx_gallery_thumbnail_path = '_static/thumbnails/sphx_glr_analyze_thumb.png'\n\n# Code source: Andrew Heusser\n# License: MIT\n\n# load hypertools\nimport hypertools as hyp\n\n# load the data\ngeo = hyp.load('weights')\ndata = geo.get_data()\n\n# process the data\ndata = hyp.analyze(data, normalize='within', reduce='PCA', ndims=10,\n align='hyper')\n\n# plot it\nhyp.plot(data)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.22" } }, "nbformat": 4, "nbformat_minor": 0 }