Skip to content

Commit 92d8b19

Browse files
committed
Changed img tags to markdown
1 parent 9a9ed7b commit 92d8b19

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

docs/Tutorial_0.ipynb

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,20 @@
3232
"cell_type": "markdown",
3333
"metadata": {},
3434
"source": [
35-
"To analyze this time series with length `n = 13`, we could visualize the data or calculate global summary statistics (i.e., mean, median, mode, min, max). If you had a much longer time series, then you may even feel compelled to build an ARIMA model, perform anomaly detection, or attempt a forecasting model but these methods can be complicated and may often have false positives or no interpretable insights.\n",
36-
"\n",
37-
"<img src=\"images/time_series_viz.jpeg\" width=800>\n",
38-
"\n",
35+
"To analyze this time series with length `n = 13`, we could visualize the data or calculate global summary statistics (i.e., mean, median, mode, min, max). If you had a much longer time series, then you may even feel compelled to build an ARIMA model, perform anomaly detection, or attempt a forecasting model but these methods can be complicated and may often have false positives or no interpretable insights."
36+
]
37+
},
38+
{
39+
"cell_type": "markdown",
40+
"metadata": {},
41+
"source": [
42+
"![Time Series Visualization](images/time_series_viz.jpeg)"
43+
]
44+
},
45+
{
46+
"cell_type": "markdown",
47+
"metadata": {},
48+
"source": [
3949
"However, if we were to apply <i>Occam's Razor</i>, then what is the most <b>simple and intuitive</b> approach that we could take analyze to this time series?\n",
4050
"\n",
4151
"To answer this question, let's start with our first defintion:"
@@ -49,9 +59,16 @@
4959
"\n",
5060
"### <i>a part or section of the full time series</i>\n",
5161
"\n",
52-
"So, the following are all considered subsequences of our `time_series` since they can all be found in the time series above.\n",
53-
"\n",
54-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/subsequence_a.jpeg\" width=400><img src=\"images/subsequence_b.jpeg\" width=400><img src=\"images/subsequence_c.jpeg\" width=400></div>"
62+
"So, the following are all considered subsequences of our `time_series` since they can all be found in the time series above."
63+
]
64+
},
65+
{
66+
"cell_type": "markdown",
67+
"metadata": {},
68+
"source": [
69+
"![Subsequence 1](images/subsequence_a.jpeg)\n",
70+
"![Subsequence 2](images/subsequence_b.jpeg)\n",
71+
"![Subsequence 3](images/subsequence_c.jpeg)"
5572
]
5673
},
5774
{
@@ -110,7 +127,7 @@
110127
"cell_type": "markdown",
111128
"metadata": {},
112129
"source": [
113-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/subsequences.jpeg\" width=800></div>"
130+
"![Subsequences](images/subsequences.jpeg)"
114131
]
115132
},
116133
{
@@ -121,9 +138,14 @@
121138
"\n",
122139
"## Euclidean Distance /yo͞oˈklidēən/ /ˈdistəns/ noun\n",
123140
"\n",
124-
"### <i>the straight-line distance between two points</i>\n",
125-
"\n",
126-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/euclidean_distance.jpeg\" width=800></div>"
141+
"### <i>the straight-line distance between two points</i>"
142+
]
143+
},
144+
{
145+
"cell_type": "markdown",
146+
"metadata": {},
147+
"source": [
148+
"![Euclidean Distance](images/euclidean_distance.jpeg)"
127149
]
128150
},
129151
{
@@ -156,21 +178,21 @@
156178
"\n",
157179
"Now, we can take this a step further where he keep one subsequence the same (reference subsequence), change the second subsequence in a sliding window manner, and compute the Euclidean distance for each window. The resulting vector of pairwise Euclidean distances is also known as a <i><b>distance profile</b></i>.\n",
158180
"\n",
159-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/pairwise_euclidean_distance.gif\" width=800></div>\n",
181+
"![Pairwise Euclidean Distance](images/pairwise_euclidean_distance.gif)\n",
160182
"\n",
161183
"Of course, not all of these distances are useful. Specifically, the distance for the self match (or trivial match) isn't informative since the distance will be always be zero when you are comparing a subsequence with itself. So, we'll ignore it and, instead, take note of the next smallest distance from the distance profile and choose that as our best match:\n",
162184
"\n",
163-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/trivial_match.jpeg\" width=800></div>\n",
185+
"![Trivial Match](images/trivial_match.jpeg\")\n",
164186
"\n",
165187
"Next, we can shift our reference subsequence over one element at a time and repeat the same sliding window process to compute the distance profile for each new reference subsequence.\n",
166188
"\n",
167-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/distance_matrix.gif\" width=800></div>\n",
189+
"![Distance Matrix](images/distance_matrix.gif)\n",
168190
"\n",
169191
"## Distance Matrix\n",
170192
"\n",
171193
"If we take all of the distance profiles that were computed for each reference subsequence and stack them one on top of each other then we get something called a <i><b>distance matrix</b></i>\n",
172194
"\n",
173-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/distance_matrix.jpeg\" width=800></div>\n",
195+
"![Distance Matrix](images/distance_matrix.jpeg)\n",
174196
"\n",
175197
"## The Real Problem - The Brute Force Approach\n",
176198
"\n",
@@ -255,7 +277,7 @@
255277
"\n",
256278
"Practically, what this means is that the matrix profile is only interested in storing the smallest non-trivial distances from each distance profile, which significantly reduces the spatial complexity to O(n):\n",
257279
"\n",
258-
"<div style='margin-left: auto;margin-right: auto; text-align: center;'><img src=\"images/matrix_profile.gif\" width=800></div>\n",
280+
"![Matrix Profile](images/matrix_profile.gif)\n",
259281
"\n",
260282
"But we still haven't figured out how to reduce the computational complexity and this is precisely the problem that is being addressed by [STUMPY](https://github.com/TDAmeritrade/stumpy)."
261283
]

0 commit comments

Comments
 (0)