Skip to content

Commit 4778853

Browse files
committed
Added AB-Join Tutorial, Updated Shapelet Tutorial
1 parent 908ba65 commit 4778853

File tree

2 files changed

+335
-341
lines changed

2 files changed

+335
-341
lines changed

docs/Tutorial_AB_Joins.ipynb

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Matrix Profile"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"%matplotlib inline\n",
17+
"\n",
18+
"import stumpy\n",
19+
"import pandas as pd\n",
20+
"import numpy as np\n",
21+
"from zipfile import ZipFile\n",
22+
"from io import BytesIO\n",
23+
"import os\n",
24+
"from urllib.request import urlopen\n",
25+
"from scipy.io import loadmat\n",
26+
"import matplotlib.pyplot as plt"
27+
]
28+
},
29+
{
30+
"cell_type": "code",
31+
"execution_count": 2,
32+
"metadata": {},
33+
"outputs": [],
34+
"source": [
35+
"fzip = ZipFile(BytesIO(urlopen(\"https://www.dropbox.com/s/ybzkw5v6h46bv22/figure9_10.zip?dl=1&sa=D&sntz=1&usg=AFQjCNEDp3G8OKGC-Zj5yucpSSCz7WRpRg\").read()))\n",
36+
"mat = fzip.extract(\"figure9_10/data.mat\")\n",
37+
"data = loadmat(mat)\n",
38+
"queen_df = pd.DataFrame(data['mfcc_queen'][0], columns=['under_pressure'])\n",
39+
"vanilla_ice_df = pd.DataFrame(data['mfcc_vanilla_ice'][0], columns=['ice_ice_baby'])\n",
40+
"os.remove(mat)"
41+
]
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": 3,
46+
"metadata": {},
47+
"outputs": [
48+
{
49+
"data": {
50+
"text/html": [
51+
"<div>\n",
52+
"<style scoped>\n",
53+
" .dataframe tbody tr th:only-of-type {\n",
54+
" vertical-align: middle;\n",
55+
" }\n",
56+
"\n",
57+
" .dataframe tbody tr th {\n",
58+
" vertical-align: top;\n",
59+
" }\n",
60+
"\n",
61+
" .dataframe thead th {\n",
62+
" text-align: right;\n",
63+
" }\n",
64+
"</style>\n",
65+
"<table border=\"1\" class=\"dataframe\">\n",
66+
" <thead>\n",
67+
" <tr style=\"text-align: right;\">\n",
68+
" <th></th>\n",
69+
" <th>under_pressure</th>\n",
70+
" </tr>\n",
71+
" </thead>\n",
72+
" <tbody>\n",
73+
" <tr>\n",
74+
" <th>0</th>\n",
75+
" <td>0.000000</td>\n",
76+
" </tr>\n",
77+
" <tr>\n",
78+
" <th>1</th>\n",
79+
" <td>0.000000</td>\n",
80+
" </tr>\n",
81+
" <tr>\n",
82+
" <th>2</th>\n",
83+
" <td>0.000000</td>\n",
84+
" </tr>\n",
85+
" <tr>\n",
86+
" <th>3</th>\n",
87+
" <td>0.000000</td>\n",
88+
" </tr>\n",
89+
" <tr>\n",
90+
" <th>4</th>\n",
91+
" <td>0.000000</td>\n",
92+
" </tr>\n",
93+
" <tr>\n",
94+
" <th>...</th>\n",
95+
" <td>...</td>\n",
96+
" </tr>\n",
97+
" <tr>\n",
98+
" <th>24284</th>\n",
99+
" <td>-10.345686</td>\n",
100+
" </tr>\n",
101+
" <tr>\n",
102+
" <th>24285</th>\n",
103+
" <td>-8.044997</td>\n",
104+
" </tr>\n",
105+
" <tr>\n",
106+
" <th>24286</th>\n",
107+
" <td>-8.876411</td>\n",
108+
" </tr>\n",
109+
" <tr>\n",
110+
" <th>24287</th>\n",
111+
" <td>-8.796413</td>\n",
112+
" </tr>\n",
113+
" <tr>\n",
114+
" <th>24288</th>\n",
115+
" <td>-8.356694</td>\n",
116+
" </tr>\n",
117+
" </tbody>\n",
118+
"</table>\n",
119+
"<p>24289 rows × 1 columns</p>\n",
120+
"</div>"
121+
],
122+
"text/plain": [
123+
" under_pressure\n",
124+
"0 0.000000\n",
125+
"1 0.000000\n",
126+
"2 0.000000\n",
127+
"3 0.000000\n",
128+
"4 0.000000\n",
129+
"... ...\n",
130+
"24284 -10.345686\n",
131+
"24285 -8.044997\n",
132+
"24286 -8.876411\n",
133+
"24287 -8.796413\n",
134+
"24288 -8.356694\n",
135+
"\n",
136+
"[24289 rows x 1 columns]"
137+
]
138+
},
139+
"execution_count": 3,
140+
"metadata": {},
141+
"output_type": "execute_result"
142+
}
143+
],
144+
"source": [
145+
"queen_df"
146+
]
147+
},
148+
{
149+
"cell_type": "code",
150+
"execution_count": 4,
151+
"metadata": {},
152+
"outputs": [
153+
{
154+
"data": {
155+
"text/html": [
156+
"<div>\n",
157+
"<style scoped>\n",
158+
" .dataframe tbody tr th:only-of-type {\n",
159+
" vertical-align: middle;\n",
160+
" }\n",
161+
"\n",
162+
" .dataframe tbody tr th {\n",
163+
" vertical-align: top;\n",
164+
" }\n",
165+
"\n",
166+
" .dataframe thead th {\n",
167+
" text-align: right;\n",
168+
" }\n",
169+
"</style>\n",
170+
"<table border=\"1\" class=\"dataframe\">\n",
171+
" <thead>\n",
172+
" <tr style=\"text-align: right;\">\n",
173+
" <th></th>\n",
174+
" <th>ice_ice_baby</th>\n",
175+
" </tr>\n",
176+
" </thead>\n",
177+
" <tbody>\n",
178+
" <tr>\n",
179+
" <th>0</th>\n",
180+
" <td>-10.992350</td>\n",
181+
" </tr>\n",
182+
" <tr>\n",
183+
" <th>1</th>\n",
184+
" <td>-11.066199</td>\n",
185+
" </tr>\n",
186+
" <tr>\n",
187+
" <th>2</th>\n",
188+
" <td>-11.019284</td>\n",
189+
" </tr>\n",
190+
" <tr>\n",
191+
" <th>3</th>\n",
192+
" <td>-9.691009</td>\n",
193+
" </tr>\n",
194+
" <tr>\n",
195+
" <th>4</th>\n",
196+
" <td>-10.698435</td>\n",
197+
" </tr>\n",
198+
" <tr>\n",
199+
" <th>...</th>\n",
200+
" <td>...</td>\n",
201+
" </tr>\n",
202+
" <tr>\n",
203+
" <th>23090</th>\n",
204+
" <td>-4.375942</td>\n",
205+
" </tr>\n",
206+
" <tr>\n",
207+
" <th>23091</th>\n",
208+
" <td>-3.573949</td>\n",
209+
" </tr>\n",
210+
" <tr>\n",
211+
" <th>23092</th>\n",
212+
" <td>-3.249252</td>\n",
213+
" </tr>\n",
214+
" <tr>\n",
215+
" <th>23093</th>\n",
216+
" <td>-3.938464</td>\n",
217+
" </tr>\n",
218+
" <tr>\n",
219+
" <th>23094</th>\n",
220+
" <td>-3.413254</td>\n",
221+
" </tr>\n",
222+
" </tbody>\n",
223+
"</table>\n",
224+
"<p>23095 rows × 1 columns</p>\n",
225+
"</div>"
226+
],
227+
"text/plain": [
228+
" ice_ice_baby\n",
229+
"0 -10.992350\n",
230+
"1 -11.066199\n",
231+
"2 -11.019284\n",
232+
"3 -9.691009\n",
233+
"4 -10.698435\n",
234+
"... ...\n",
235+
"23090 -4.375942\n",
236+
"23091 -3.573949\n",
237+
"23092 -3.249252\n",
238+
"23093 -3.938464\n",
239+
"23094 -3.413254\n",
240+
"\n",
241+
"[23095 rows x 1 columns]"
242+
]
243+
},
244+
"execution_count": 4,
245+
"metadata": {},
246+
"output_type": "execute_result"
247+
}
248+
],
249+
"source": [
250+
"vanilla_ice_df"
251+
]
252+
},
253+
{
254+
"cell_type": "code",
255+
"execution_count": null,
256+
"metadata": {},
257+
"outputs": [],
258+
"source": []
259+
}
260+
],
261+
"metadata": {
262+
"kernelspec": {
263+
"display_name": "Python 3",
264+
"language": "python",
265+
"name": "python3"
266+
},
267+
"language_info": {
268+
"codemirror_mode": {
269+
"name": "ipython",
270+
"version": 3
271+
},
272+
"file_extension": ".py",
273+
"mimetype": "text/x-python",
274+
"name": "python",
275+
"nbconvert_exporter": "python",
276+
"pygments_lexer": "ipython3",
277+
"version": "3.7.9"
278+
}
279+
},
280+
"nbformat": 4,
281+
"nbformat_minor": 4
282+
}

0 commit comments

Comments
 (0)