You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
window_size =50# Approximately, how many data points might be found in a pattern
116
116
all_gpu_devices = [device.id for device in cuda.list_devices()] # Get a list of all available GPU devices
117
117
@@ -125,7 +125,7 @@ Multi-dimensional time series data with `MSTUMP <https://stumpy.readthedocs.io/e
125
125
import numpy as np
126
126
127
127
if__name__=="__main__":
128
-
your_time_series = np.random.rand(3, 1000) # Each row represents data from a different dimension while each column represents data from the same dimension
128
+
your_time_series = np.random.default_rng().random((3, 1000)) # Each row represents data from a different dimension while each column represents data from the same dimension
129
129
window_size =50# Approximately, how many data points might be found in a pattern
@@ -140,7 +140,7 @@ Distributed multi-dimensional time series data analysis with Dask Distributed `M
140
140
141
141
if__name__=="__main__":
142
142
with Client() as dask_client:
143
-
your_time_series = np.random.rand(3, 1000) # Each row represents data from a different dimension while each column represents data from the same dimension
143
+
your_time_series = np.random.default_rng().random((3, 1000)) # Each row represents data from a different dimension while each column represents data from the same dimension
144
144
window_size =50# Approximately, how many data points might be found in a pattern
@@ -236,7 +236,7 @@ In order to fully understand and appreciate the underlying algorithms and applic
236
236
Performance
237
237
-----------
238
238
239
-
We tested the performance of computing the exact matrix profile using the Numba JIT compiled version of the code on randomly generated time series data with various lengths (i.e., ``np.random.rand(n)``) along with different `CPU and GPU hardware resources <hardware_>`_.
239
+
We tested the performance of computing the exact matrix profile using the Numba JIT compiled version of the code on randomly generated time series data with various lengths (i.e., ``np.random.default_rng().random(n)``) along with different `CPU and GPU hardware resources <hardware_>`_.
Copy file name to clipboardExpand all lines: docs/Tutorial_Fast_Approximate_Matrix_Profiles.ipynb
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -334,11 +334,14 @@
334
334
"cell_type": "markdown",
335
335
"metadata": {},
336
336
"source": [
337
-
"Please keep in mind that the approximate matrix profile is computed by randomly computing distances along a subset of diagonals. So, each time you initialize a new `scrump` object by calling `stumpy.scrump`, this will randomly shuffle the order that the distances are computed, which inevitably results in different approximate matrix profiles (except when `percentage=1.0`). Depending on your use case, to ensure reproducible results, you may consider setting random seed prior to calling `stumpy.scrump`:\n",
337
+
"Please keep in mind that the approximate matrix profile is computed by randomly computing distances along a subset of diagonals. So, each time you initialize a new `scrump` object by calling `stumpy.scrump`, this will randomly shuffle the order that the distances are computed, which inevitably results in different approximate matrix profiles (except when `percentage=1.0`). Depending on your use case, to ensure reproducible results, you may consider fixing the random state prior to calling `stumpy.scrump`:\n",
338
338
"\n",
339
339
"```\n",
340
-
"seed = np.random.randint(100000)\n",
341
-
"np.random.seed(seed)\n",
340
+
"# Get and set random state\n",
341
+
"from stumpy import rng\n",
342
+
"state = rng.get_state()\n",
343
+
"rng.set_state(state)\n",
344
+
"\n",
342
345
"approx = stumpy.scrump(steam_df['steam flow'], m, percentage=0.01, pre_scrump=False)\n",
0 commit comments