|
166 | 166 | { |
167 | 167 | "data": { |
168 | 168 | "text/plain": [ |
169 | | - "<matplotlib.patches.Rectangle at 0x1a1af70c50>" |
| 169 | + "<matplotlib.patches.Rectangle at 0x1a23f3c590>" |
170 | 170 | ] |
171 | 171 | }, |
172 | 172 | "execution_count": 4, |
|
216 | 216 | { |
217 | 217 | "data": { |
218 | 218 | "text/plain": [ |
219 | | - "<matplotlib.patches.FancyArrowPatch at 0x1a1b942f50>" |
| 219 | + "<matplotlib.patches.FancyArrowPatch at 0x1a24906690>" |
220 | 220 | ] |
221 | 221 | }, |
222 | 222 | "execution_count": 5, |
|
336 | 336 | { |
337 | 337 | "data": { |
338 | 338 | "text/plain": [ |
339 | | - "<matplotlib.lines.Line2D at 0x1a1ecba590>" |
| 339 | + "<matplotlib.lines.Line2D at 0x1a27c71e90>" |
340 | 340 | ] |
341 | 341 | }, |
342 | 342 | "execution_count": 8, |
|
397 | 397 | { |
398 | 398 | "data": { |
399 | 399 | "text/plain": [ |
400 | | - "[<matplotlib.lines.Line2D at 0x1a1f6e48d0>]" |
| 400 | + "[<matplotlib.lines.Line2D at 0x1a2829be50>]" |
401 | 401 | ] |
402 | 402 | }, |
403 | 403 | "execution_count": 10, |
|
432 | 432 | "source": [ |
433 | 433 | "## Streaming Data with FLOSS\n", |
434 | 434 | "\n", |
435 | | - "Instead of manually computing `CAC_1D` like we did above on streaming data, we can actually call the `floss` function directly which returns back a Python generator. To demonstrate the use of `floss`, let's take some `old_data` and compute the matrix profile indices for it like we did above:" |
| 435 | + "Instead of manually computing `CAC_1D` like we did above on streaming data, we can actually call the `floss` function directly which instantiates a streaming object. To demonstrate the use of `floss`, let's take some `old_data` and compute the matrix profile indices for it like we did above:" |
436 | 436 | ] |
437 | 437 | }, |
438 | 438 | { |
|
490 | 490 | "source": [ |
491 | 491 | "You can now update the `stream` with a new data points `t` via the `stream.update(t)` function and this will slide your window over by one data point and it will automatically update:\n", |
492 | 492 | "\n", |
493 | | - "1. the `CAC_1D` (accessed via the `.cac_` attribute)\n", |
| 493 | + "1. the `CAC_1D` (accessed via the `.cac_1d_` attribute)\n", |
494 | 494 | "2. the matrix profile (accessed via the `.P_` attribute)\n", |
495 | 495 | "3. the matrix profile indices (accessed via the `.I_` attribute)\n", |
496 | 496 | "4. the sliding window of data used to produce the `CAC_1D` (accessed via the `.T_` attribute - this should be the same size as the length of the `old_data\\)\n", |
|
509 | 509 | " stream.update(t)\n", |
510 | 510 | " \n", |
511 | 511 | " if i % 100 == 0:\n", |
512 | | - " windows.append((stream.T_, stream.cac_))" |
| 512 | + " windows.append((stream.T_, stream.cac_1d_))" |
513 | 513 | ] |
514 | 514 | }, |
515 | 515 | { |
|
713 | 713 | "</style>\n", |
714 | 714 | "\n", |
715 | 715 | "<div class=\"animation\">\n", |
716 | | - " <img id=\"_anim_img204d1463aef24511af3f0fdcc804e18c\">\n", |
| 716 | + " <img id=\"_anim_img0f56a5975dc74a08b11a47ed20620d95\">\n", |
717 | 717 | " <div class=\"anim-controls\">\n", |
718 | | - " <input id=\"_anim_slider204d1463aef24511af3f0fdcc804e18c\" type=\"range\" class=\"anim-slider\"\n", |
| 718 | + " <input id=\"_anim_slider0f56a5975dc74a08b11a47ed20620d95\" type=\"range\" class=\"anim-slider\"\n", |
719 | 719 | " name=\"points\" min=\"0\" max=\"1\" step=\"1\" value=\"0\"\n", |
720 | | - " oninput=\"anim204d1463aef24511af3f0fdcc804e18c.set_frame(parseInt(this.value));\"></input>\n", |
| 720 | + " oninput=\"anim0f56a5975dc74a08b11a47ed20620d95.set_frame(parseInt(this.value));\"></input>\n", |
721 | 721 | " <div class=\"anim-buttons\">\n", |
722 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.slower()\"><i class=\"fa fa-minus\"></i></button>\n", |
723 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.first_frame()\"><i class=\"fa fa-fast-backward\">\n", |
| 722 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.slower()\"><i class=\"fa fa-minus\"></i></button>\n", |
| 723 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.first_frame()\"><i class=\"fa fa-fast-backward\">\n", |
724 | 724 | " </i></button>\n", |
725 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.previous_frame()\">\n", |
| 725 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.previous_frame()\">\n", |
726 | 726 | " <i class=\"fa fa-step-backward\"></i></button>\n", |
727 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.reverse_animation()\">\n", |
| 727 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.reverse_animation()\">\n", |
728 | 728 | " <i class=\"fa fa-play fa-flip-horizontal\"></i></button>\n", |
729 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.pause_animation()\"><i class=\"fa fa-pause\">\n", |
| 729 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.pause_animation()\"><i class=\"fa fa-pause\">\n", |
730 | 730 | " </i></button>\n", |
731 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.play_animation()\"><i class=\"fa fa-play\"></i>\n", |
| 731 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.play_animation()\"><i class=\"fa fa-play\"></i>\n", |
732 | 732 | " </button>\n", |
733 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.next_frame()\"><i class=\"fa fa-step-forward\">\n", |
| 733 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.next_frame()\"><i class=\"fa fa-step-forward\">\n", |
734 | 734 | " </i></button>\n", |
735 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.last_frame()\"><i class=\"fa fa-fast-forward\">\n", |
| 735 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.last_frame()\"><i class=\"fa fa-fast-forward\">\n", |
736 | 736 | " </i></button>\n", |
737 | | - " <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.faster()\"><i class=\"fa fa-plus\"></i></button>\n", |
| 737 | + " <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.faster()\"><i class=\"fa fa-plus\"></i></button>\n", |
738 | 738 | " </div>\n", |
739 | | - " <form action=\"#n\" name=\"_anim_loop_select204d1463aef24511af3f0fdcc804e18c\" class=\"anim-state\">\n", |
740 | | - " <input type=\"radio\" name=\"state\" value=\"once\" id=\"_anim_radio1_204d1463aef24511af3f0fdcc804e18c\"\n", |
| 739 | + " <form action=\"#n\" name=\"_anim_loop_select0f56a5975dc74a08b11a47ed20620d95\" class=\"anim-state\">\n", |
| 740 | + " <input type=\"radio\" name=\"state\" value=\"once\" id=\"_anim_radio1_0f56a5975dc74a08b11a47ed20620d95\"\n", |
741 | 741 | " >\n", |
742 | | - " <label for=\"_anim_radio1_204d1463aef24511af3f0fdcc804e18c\">Once</label>\n", |
743 | | - " <input type=\"radio\" name=\"state\" value=\"loop\" id=\"_anim_radio2_204d1463aef24511af3f0fdcc804e18c\"\n", |
| 742 | + " <label for=\"_anim_radio1_0f56a5975dc74a08b11a47ed20620d95\">Once</label>\n", |
| 743 | + " <input type=\"radio\" name=\"state\" value=\"loop\" id=\"_anim_radio2_0f56a5975dc74a08b11a47ed20620d95\"\n", |
744 | 744 | " checked>\n", |
745 | | - " <label for=\"_anim_radio2_204d1463aef24511af3f0fdcc804e18c\">Loop</label>\n", |
746 | | - " <input type=\"radio\" name=\"state\" value=\"reflect\" id=\"_anim_radio3_204d1463aef24511af3f0fdcc804e18c\"\n", |
| 745 | + " <label for=\"_anim_radio2_0f56a5975dc74a08b11a47ed20620d95\">Loop</label>\n", |
| 746 | + " <input type=\"radio\" name=\"state\" value=\"reflect\" id=\"_anim_radio3_0f56a5975dc74a08b11a47ed20620d95\"\n", |
747 | 747 | " >\n", |
748 | | - " <label for=\"_anim_radio3_204d1463aef24511af3f0fdcc804e18c\">Reflect</label>\n", |
| 748 | + " <label for=\"_anim_radio3_0f56a5975dc74a08b11a47ed20620d95\">Reflect</label>\n", |
749 | 749 | " </form>\n", |
750 | 750 | " </div>\n", |
751 | 751 | "</div>\n", |
|
755 | 755 | " /* Instantiate the Animation class. */\n", |
756 | 756 | " /* The IDs given should match those used in the template above. */\n", |
757 | 757 | " (function() {\n", |
758 | | - " var img_id = \"_anim_img204d1463aef24511af3f0fdcc804e18c\";\n", |
759 | | - " var slider_id = \"_anim_slider204d1463aef24511af3f0fdcc804e18c\";\n", |
760 | | - " var loop_select_id = \"_anim_loop_select204d1463aef24511af3f0fdcc804e18c\";\n", |
| 758 | + " var img_id = \"_anim_img0f56a5975dc74a08b11a47ed20620d95\";\n", |
| 759 | + " var slider_id = \"_anim_slider0f56a5975dc74a08b11a47ed20620d95\";\n", |
| 760 | + " var loop_select_id = \"_anim_loop_select0f56a5975dc74a08b11a47ed20620d95\";\n", |
761 | 761 | " var frames = new Array(50);\n", |
762 | 762 | " \n", |
763 | 763 | " frames[0] = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAGwCAYAAABfOcJAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\\\n", |
|
59156 | 59156 | " /* set a timeout to make sure all the above elements are created before\n", |
59157 | 59157 | " the object is initialized. */\n", |
59158 | 59158 | " setTimeout(function() {\n", |
59159 | | - " anim204d1463aef24511af3f0fdcc804e18c = new Animation(frames, img_id, slider_id, 100.0,\n", |
| 59159 | + " anim0f56a5975dc74a08b11a47ed20620d95 = new Animation(frames, img_id, slider_id, 100.0,\n", |
59160 | 59160 | " loop_select_id);\n", |
59161 | 59161 | " }, 0);\n", |
59162 | 59162 | " })()\n", |
|
0 commit comments