Skip to content

Commit

Permalink
Merge pull request #92 from ContextLab/google-drive
Browse files Browse the repository at this point in the history
Google drive
  • Loading branch information
andrewheusser authored Apr 17, 2017
2 parents 32f1b8c + 703177f commit 18897d9
Show file tree
Hide file tree
Showing 267 changed files with 961 additions and 8,671 deletions.
Binary file modified docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/animate.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/explore.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_PPCA.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_align.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_basic.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_clusters.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_clusters2.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_customize_figure.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_dataframe.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_describe.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_digits.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_group.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_labels.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_legend.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_missing_data.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/plot_procrustes.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/save_image.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/save_movie.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/hypertools.tools.describe_pca.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/doctrees/hypertools.tools.normalize.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/animate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=data['weights'][0]\nw = [i for i in w]\naligned_w = hyp.tools.align(w)\n\nw1 = np.mean(aligned_w[:17],0)\nw2 = np.mean(aligned_w[18:],0)\n\nhyp.plot([w1,w2],animate=True, duration=100)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights')\nw = [i for i in data]\naligned_w = hyp.tools.align(w)\n\nw1 = np.mean(aligned_w[:17],0)\nw2 = np.mean(aligned_w[18:],0)\n\nhyp.plot([w1,w2],animate=True)"
],
"outputs": [],
"metadata": {
Expand Down
7 changes: 3 additions & 4 deletions docs/_build/html/_downloads/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=data['weights'][0]
w = [i for i in w]
data = hyp.tools.load('weights')
w = [i for i in data]
aligned_w = hyp.tools.align(w)

w1 = np.mean(aligned_w[:17],0)
w2 = np.mean(aligned_w[18:],0)

hyp.plot([w1,w2],animate=True, duration=100)
hyp.plot([w1,w2],animate=True)
Binary file modified docs/_build/html/_downloads/auto_examples_jupyter.zip
Binary file not shown.
Binary file modified docs/_build/html/_downloads/auto_examples_python.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/explore.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:2]]\n\nhyp.plot(w,'o', explore=True)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights_sample')\n\nhyp.plot(data, 'o', explore=True)"
],
"outputs": [],
"metadata": {
Expand Down
5 changes: 2 additions & 3 deletions docs/_build/html/_downloads/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:2]]
data = hyp.tools.load('weights_sample')

hyp.plot(w,'o', explore=True)
hyp.plot(data, 'o', explore=True)
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_PPCA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nfrom scipy.linalg import toeplitz\nimport numpy as np\nfrom copy import copy\nimport hypertools as hyp\n\nK = 10 - toeplitz(np.arange(10))\n\ndata1 = np.cumsum(np.random.multivariate_normal(np.zeros(10), K, 250), axis=0)\ndata2 = copy(data1)\n\nmissing = .1\ninds = [(i,j) for i in range(data2.shape[0]) for j in range(data2.shape[1])]\nmissing_data = [inds[i] for i in np.random.choice(len(inds), len(inds)*missing)]\nfor i,j in missing_data:\n data2[i,j]=np.nan\n\nhyp.plot([data1,data2],linestyle=['-',':'], legend=['Original', 'PPCA'])"
"# Code source: Andrew Heusser\n# License: MIT\n\nfrom scipy.linalg import toeplitz\nimport numpy as np\nfrom copy import copy\nimport hypertools as hyp\n\nK = 10 - toeplitz(np.arange(10))\n\ndata1 = np.cumsum(np.random.multivariate_normal(np.zeros(10), K, 250), axis=0)\ndata2 = copy(data1)\n\nmissing = .1\ninds = [(i,j) for i in range(data2.shape[0]) for j in range(data2.shape[1])]\nmissing_data = [inds[i] for i in np.random.choice(int(len(inds)), int(len(inds)*missing))]\nfor i,j in missing_data:\n data2[i,j]=np.nan\n\nhyp.plot([data1,data2],linestyle=['-',':'], legend=['Original', 'PPCA'])"
],
"outputs": [],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_PPCA.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

missing = .1
inds = [(i,j) for i in range(data2.shape[0]) for j in range(data2.shape[1])]
missing_data = [inds[i] for i in np.random.choice(len(inds), len(inds)*missing)]
missing_data = [inds[i] for i in np.random.choice(int(len(inds)), int(len(inds)*missing))]
for i,j in missing_data:
data2[i,j]=np.nan

Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_align.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\n\nw=data['weights'][0]\nw = [i for i in w]\naligned_w = hyp.tools.align(w)\n\nw1 = np.mean(aligned_w[:17],0)\nw2 = np.mean(aligned_w[18:],0)\n\nhyp.plot([w1[:100,:],w2[:100,:]])"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights')\nw = [i for i in data]\naligned_w = hyp.tools.align(w)\n\nw1 = np.mean(aligned_w[:17],0)\nw2 = np.mean(aligned_w[18:],0)\n\nhyp.plot([w1[:100,:],w2[:100,:]])"
],
"outputs": [],
"metadata": {
Expand Down
6 changes: 2 additions & 4 deletions docs/_build/html/_downloads/plot_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')

w=data['weights'][0]
w = [i for i in w]
data = hyp.tools.load('weights')
w = [i for i in data]
aligned_w = hyp.tools.align(w)

w1 = np.mean(aligned_w[:17],0)
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:2]]\n\nhyp.plot(w,'o')"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\n\ndata = hyp.tools.load('weights_sample')\n\nhyp.plot(data,'o')"
],
"outputs": [],
"metadata": {
Expand Down
7 changes: 2 additions & 5 deletions docs/_build/html/_downloads/plot_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
# License: MIT

import hypertools as hyp
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:2]]
data = hyp.tools.load('weights_sample')

hyp.plot(w,'o')
hyp.plot(data,'o')
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_clusters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport pandas as pd\n\ndata=pd.read_csv('sample_data/mushrooms.csv')\n\nhyp.plot(data,'o',n_clusters=10)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport pandas as pd\n\ndata = hyp.tools.load('mushrooms')\n\nhyp.plot(data,'o',n_clusters=10)"
],
"outputs": [],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
import hypertools as hyp
import pandas as pd

data=pd.read_csv('sample_data/mushrooms.csv')
data = hyp.tools.load('mushrooms')

hyp.plot(data,'o',n_clusters=10)
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_customize_figure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:2]]\n\nfig,ax,data = hyp.plot(w,'o', ndims=2, legend=['Group A', 'Group B'], show=False, return_data=True)\n\nax.set_title('This is an example title', fontsize=20)\nax.set_ylabel('PCA Dimension 2', fontsize=15)\nax.set_xlabel('PCA Dimension 1', fontsize=15)\nlegend_text = plt.gca().get_legend().get_texts()\nplt.setp(legend_text, fontsize=15)\n\nplt.show()"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata = hyp.tools.load('weights_sample')\n\nfig,ax,data = hyp.plot(data[:2], 'o', ndims=2, legend=['Group A', 'Group B'], show=False, return_data=True)\n\nax.set_title('This is an example title', fontsize=20)\nax.set_ylabel('PCA Dimension 2', fontsize=15)\nax.set_xlabel('PCA Dimension 1', fontsize=15)\nlegend_text = plt.gca().get_legend().get_texts()\nplt.setp(legend_text, fontsize=15)\n\nplt.show()"
],
"outputs": [],
"metadata": {
Expand Down
5 changes: 2 additions & 3 deletions docs/_build/html/_downloads/plot_customize_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
import numpy as np
import matplotlib.pyplot as plt

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:2]]
data = hyp.tools.load('weights_sample')

fig,ax,data = hyp.plot(w,'o', ndims=2, legend=['Group A', 'Group B'], show=False, return_data=True)
fig,ax,data = hyp.plot(data[:2], 'o', ndims=2, legend=['Group A', 'Group B'], show=False, return_data=True)

ax.set_title('This is an example title', fontsize=20)
ax.set_ylabel('PCA Dimension 2', fontsize=15)
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_dataframe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport pandas as pd\n\ndata = pd.read_csv('sample_data/mushrooms.csv')\ngroup = data.pop('class')\n\nhyp.plot(data,'o', group=group)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport pandas as pd\n\ndata = hyp.tools.load('mushrooms')\n\ngroup = data.pop('class')\n\nhyp.plot(data, 'o', group=group)"
],
"outputs": [],
"metadata": {
Expand Down
5 changes: 3 additions & 2 deletions docs/_build/html/_downloads/plot_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import hypertools as hyp
import pandas as pd

data = pd.read_csv('sample_data/mushrooms.csv')
data = hyp.tools.load('mushrooms')

group = data.pop('class')

hyp.plot(data,'o', group=group)
hyp.plot(data, 'o', group=group)
4 changes: 2 additions & 2 deletions docs/_build/html/_downloads/plot_describe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
{
"source": [
"\n# Using describe_pca to evaluate the integrity of your visualization\n\n\nThe downside to using PCA to visualize your data is that some variance will\nlikely be removed. To help get a sense for the integrity of your low\ndimensional visualizations, we built the `describe_pca` function, which computes\nthe covariance (samples by samples) of both the raw and reduced datasets, and\nplots their correlation. The function repeats this analysis from 2:N dimensions\nuntil the correlation reaches a local maximum. Often times this will be less\nthan the total number of dimensions because the PCA model is whitened. \n\n"
"\n# Using describe_pca to evaluate the integrity of your visualization\n\n\nThe downside to using PCA to visualize your data is that some variance will\nlikely be removed. To help get a sense for the integrity of your low\ndimensional visualizations, we built the `describe_pca` function, which computes\nthe covariance (samples by samples) of both the raw and reduced datasets, and\nplots their correlation. The function repeats this analysis from 2:N dimensions\nuntil the correlation reaches a local maximum. Often times this will be less\nthan the total number of dimensions because the PCA model is whitened.\n\n"
],
"cell_type": "markdown",
"metadata": {}
Expand All @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:3]]\n\nhyp.tools.describe_pca(w)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights_sample')\n\nhyp.tools.describe_pca(data)"
],
"outputs": [],
"metadata": {
Expand Down
7 changes: 3 additions & 4 deletions docs/_build/html/_downloads/plot_describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
the covariance (samples by samples) of both the raw and reduced datasets, and
plots their correlation. The function repeats this analysis from 2:N dimensions
until the correlation reaches a local maximum. Often times this will be less
than the total number of dimensions because the PCA model is whitened.
than the total number of dimensions because the PCA model is whitened.
"""

# Code source: Andrew Heusser
Expand All @@ -20,7 +20,6 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:3]]
data = hyp.tools.load('weights_sample')

hyp.tools.describe_pca(w)
hyp.tools.describe_pca(data)
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_group.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:3]]\n\ngroup = [['a' if idx % 2 == 0 else 'b' for idx,j in enumerate(i)] for i in w]\nhyp.plot(w,'o',group=group)\n\ngroup=[]\nfor idx,i in enumerate(w):\n tmp=[]\n for iidx,ii in enumerate(i):\n tmp.append(int(np.random.randint(1000, size=1)))\n group.append(tmp)\n\nhyp.plot(w,'o',group=group)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights_sample')\n\ngroup = [['a' if idx % 2 == 0 else 'b' for idx,j in enumerate(i)] for i in data]\nhyp.plot(data, 'o', group=group)\n\ngroup=[]\nfor idx,i in enumerate(data):\n tmp=[]\n for iidx,ii in enumerate(i):\n tmp.append(int(np.random.randint(1000, size=1)))\n group.append(tmp)\n\nhyp.plot(data, 'o', group=group)"
],
"outputs": [],
"metadata": {
Expand Down
11 changes: 5 additions & 6 deletions docs/_build/html/_downloads/plot_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:3]]
data = hyp.tools.load('weights_sample')

group = [['a' if idx % 2 == 0 else 'b' for idx,j in enumerate(i)] for i in w]
hyp.plot(w,'o',group=group)
group = [['a' if idx % 2 == 0 else 'b' for idx,j in enumerate(i)] for i in data]
hyp.plot(data, 'o', group=group)

group=[]
for idx,i in enumerate(w):
for idx,i in enumerate(data):
tmp=[]
for iidx,ii in enumerate(i):
tmp.append(int(np.random.randint(1000, size=1)))
group.append(tmp)

hyp.plot(w,'o',group=group)
hyp.plot(data, 'o', group=group)
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_labels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:3]]\n\nlabels=[]\nfor idx,i in enumerate(w):\n tmp=[]\n for iidx,ii in enumerate(i):\n if iidx==0:\n tmp.append('Subject ' + str(idx))\n else:\n tmp.append(None)\n labels.append(tmp)\n\nhyp.plot(w,'o',labels=labels)"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights_sample')\n\nlabels=[]\nfor idx,i in enumerate(data):\n tmp=[]\n for iidx,ii in enumerate(i):\n if iidx==0:\n tmp.append('Subject ' + str(idx))\n else:\n tmp.append(None)\n labels.append(tmp)\n\nhyp.plot(data, 'o', labels=labels)"
],
"outputs": [],
"metadata": {
Expand Down
7 changes: 3 additions & 4 deletions docs/_build/html/_downloads/plot_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:3]]
data = hyp.tools.load('weights_sample')

labels=[]
for idx,i in enumerate(w):
for idx,i in enumerate(data):
tmp=[]
for iidx,ii in enumerate(i):
if iidx==0:
Expand All @@ -29,4 +28,4 @@
tmp.append(None)
labels.append(tmp)

hyp.plot(w,'o',labels=labels)
hyp.plot(data, 'o', labels=labels)
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_legend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata=sio.loadmat('sample_data/weights.mat')\nw=[i for i in data['weights'][0][0:2]]\n\nhyp.plot(w,'o', legend=['Group A', 'Group B'])"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\n\ndata = hyp.tools.load('weights_sample')\n\nhyp.plot(data, 'o', legend=['Group A', 'Group B', 'Group C'])"
],
"outputs": [],
"metadata": {
Expand Down
5 changes: 2 additions & 3 deletions docs/_build/html/_downloads/plot_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import scipy.io as sio
import numpy as np

data=sio.loadmat('sample_data/weights.mat')
w=[i for i in data['weights'][0][0:2]]
data = hyp.tools.load('weights_sample')

hyp.plot(w,'o', legend=['Group A', 'Group B'])
hyp.plot(data, 'o', legend=['Group A', 'Group B', 'Group C'])
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_missing_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nfrom scipy.linalg import toeplitz\nimport numpy as np\nfrom copy import copy\nimport hypertools as hyp\n\nK = 10 - toeplitz(np.arange(10))\ndata1 = np.cumsum(np.random.multivariate_normal(np.zeros(10), K, 250), axis=0)\ndata2 = copy(data1)\n\nmissing = .05\ninds = [(i,j) for i in range(data1.shape[0]) for j in range(data1.shape[1])]\nmissing_data = [inds[i] for i in np.random.choice(len(inds), len(inds)*missing)]\nfor i,j in missing_data:\n data2[i,j]=np.nan\n\ndata1_r,data2_r = hyp.tools.reduce([data1,data2],ndims=3)\n\nmissing_inds = hyp.tools.missing_inds(data2)\nmissing_data = data2_r[missing_inds,:]\n\nhyp.plot([data1_r, data2_r, missing_data], ['r','b--','b*'])"
"# Code source: Andrew Heusser\n# License: MIT\n\nfrom scipy.linalg import toeplitz\nimport numpy as np\nfrom copy import copy\nimport hypertools as hyp\n\nK = 10 - toeplitz(np.arange(10))\ndata1 = np.cumsum(np.random.multivariate_normal(np.zeros(10), K, 250), axis=0)\ndata2 = copy(data1)\n\nmissing = .05\ninds = [(i,j) for i in range(data1.shape[0]) for j in range(data1.shape[1])]\nmissing_data = [inds[i] for i in np.random.choice(int(len(inds)), int(len(inds)*missing))]\nfor i,j in missing_data:\n data2[i,j]=np.nan\n\ndata1_r,data2_r = hyp.tools.reduce([data1,data2],ndims=3)\n\nmissing_inds = hyp.tools.missing_inds(data2)\nmissing_data = data2_r[missing_inds,:]\n\nhyp.plot([data1_r, data2_r, missing_data], ['r','b--','b*'])"
],
"outputs": [],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_missing_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

missing = .05
inds = [(i,j) for i in range(data1.shape[0]) for j in range(data1.shape[1])]
missing_data = [inds[i] for i in np.random.choice(len(inds), len(inds)*missing)]
missing_data = [inds[i] for i in np.random.choice(int(len(inds)), int(len(inds)*missing))]
for i,j in missing_data:
data2[i,j]=np.nan

Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_downloads/plot_procrustes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"execution_count": null,
"cell_type": "code",
"source": [
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata = sio.loadmat('sample_data/test_data.mat')\ntarget = data['spiral']\n\n# A random rotation matrix\nrot = np.array([[-0.89433495, -0.44719485, -0.01348182],\n [-0.43426149, 0.87492975, -0.21427761],\n [-0.10761949, 0.18578133, 0.97667976]])\n# creating new spiral with some noise\nsource = np.dot(target, rot)\n\n# Before hyperalignment\nfig,ax,data = hyp.plot([target, source], show=False, return_data=True)\nax.set_title('Before Procrustes')\nplt.show()\n\n# After hyperalignment\nfig,ax,data = hyp.plot([hyp.tools.procrustes(source, target), target], ['-','--'], show=False, return_data=True)\nax.set_title('After Procrustes')\nplt.show()"
"# Code source: Andrew Heusser\n# License: MIT\n\nimport hypertools as hyp\nimport scipy.io as sio\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata = hyp.tools.load('spiral')\ntarget = data\n\n# A random rotation matrix\nrot = np.array([[-0.89433495, -0.44719485, -0.01348182],\n [-0.43426149, 0.87492975, -0.21427761],\n [-0.10761949, 0.18578133, 0.97667976]])\n# creating new spiral with some noise\nsource = np.dot(target, rot)\n\n# Before hyperalignment\nfig,ax,data = hyp.plot([target, source], show=False, return_data=True)\nax.set_title('Before Procrustes')\nplt.show()\n\n# After hyperalignment\nfig,ax,data = hyp.plot([hyp.tools.procrustes(source, target), target], ['-','--'], show=False, return_data=True)\nax.set_title('After Procrustes')\nplt.show()"
],
"outputs": [],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/_downloads/plot_procrustes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import numpy as np
import matplotlib.pyplot as plt

data = sio.loadmat('sample_data/test_data.mat')
target = data['spiral']
data = hyp.tools.load('spiral')
target = data

# A random rotation matrix
rot = np.array([[-0.89433495, -0.44719485, -0.01348182],
Expand Down
Loading

0 comments on commit 18897d9

Please sign in to comment.