akshayballal commited on
Commit
4b2bf71
β€’
1 Parent(s): 6a62ce9

Add scaler_vav_2.pkl file

Browse files
EnergyLSTM/lstm_energy_2.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
mqttpublisher.ipynb CHANGED
The diff for this file is too large to render. See raw diff
 
physLSTM/lstm_vav_02.keras ADDED
Binary file (660 kB). View file
 
physLSTM/lstm_vav_rtu2.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 1,
6
  "metadata": {},
7
  "outputs": [],
8
  "source": [
@@ -17,7 +17,9 @@
17
  "from sklearn.model_selection import train_test_split\n",
18
  "from sklearn.preprocessing import MinMaxScaler,StandardScaler\n",
19
  "from keras.callbacks import ModelCheckpoint\n",
20
- "import tensorflow as tf"
 
 
21
  ]
22
  },
23
  {
@@ -70,7 +72,7 @@
70
  "name": "stderr",
71
  "output_type": "stream",
72
  "text": [
73
- "C:\\Users\\arbal\\AppData\\Local\\Temp\\ipykernel_38868\\1855433847.py:1: SettingWithCopyWarning: \n",
74
  "A value is trying to be set on a copy of a slice from a DataFrame.\n",
75
  "Try using .loc[row_indexer,col_indexer] = value instead\n",
76
  "\n",
@@ -528,7 +530,7 @@
528
  ],
529
  "source": [
530
  "testdataset_df = df_filtered[(df_filtered.date.dt.date >date(2020, 3, 1)) & (df_filtered.date.dt.date <date(2020,7, 1))]\n",
531
- "\n",
532
  "# traindataset_df = df_filtered[ (df_filtered.date.dt.date >date(2019, 11, 8))]\n",
533
  "\n",
534
  "traindataset_df = df_filtered[(df_filtered.date.dt.date >date(2019, 3, 1)) & (df_filtered.date.dt.date <date(2020, 3, 1)) | (df_filtered.date.dt.date >date(2020, 7, 1)) & (df_filtered.date.dt.date <date(2020, 12, 1))]\n",
@@ -573,23 +575,6 @@
573
  "cell_type": "code",
574
  "execution_count": 8,
575
  "metadata": {},
576
- "outputs": [
577
- {
578
- "name": "stdout",
579
- "output_type": "stream",
580
- "text": [
581
- "0 0\n"
582
- ]
583
- }
584
- ],
585
- "source": [
586
- "print(traindataset_df.isna().sum().sum(), testdataset_df.isna().sum().sum())"
587
- ]
588
- },
589
- {
590
- "cell_type": "code",
591
- "execution_count": 9,
592
- "metadata": {},
593
  "outputs": [
594
  {
595
  "data": {
@@ -597,7 +582,7 @@
597
  "(1073512, 391818)"
598
  ]
599
  },
600
- "execution_count": 9,
601
  "metadata": {},
602
  "output_type": "execute_result"
603
  }
@@ -608,41 +593,34 @@
608
  },
609
  {
610
  "cell_type": "code",
611
- "execution_count": 10,
612
- "metadata": {},
613
- "outputs": [],
614
- "source": [
615
- "traindataset = traindataset.astype('float32')\n",
616
- "testdataset = testdataset.astype('float32')\n",
617
- "\n",
618
- "scaler = StandardScaler()\n",
619
- "traindataset = scaler.fit_transform(traindataset)\n",
620
- "testdataset = scaler.transform(testdataset)"
621
- ]
622
- },
623
- {
624
- "cell_type": "code",
625
- "execution_count": 11,
626
  "metadata": {},
627
  "outputs": [
628
  {
629
  "data": {
630
  "text/plain": [
631
- "(1073512, 55)"
632
  ]
633
  },
634
- "execution_count": 11,
635
  "metadata": {},
636
  "output_type": "execute_result"
637
  }
638
  ],
639
  "source": [
640
- "traindataset.shape"
 
 
 
 
 
 
 
641
  ]
642
  },
643
  {
644
  "cell_type": "code",
645
- "execution_count": 12,
646
  "metadata": {},
647
  "outputs": [],
648
  "source": [
@@ -665,7 +643,7 @@
665
  },
666
  {
667
  "cell_type": "code",
668
- "execution_count": 13,
669
  "metadata": {},
670
  "outputs": [
671
  {
@@ -674,7 +652,7 @@
674
  "((1073481, 30, 55), (1073481, 31))"
675
  ]
676
  },
677
- "execution_count": 13,
678
  "metadata": {},
679
  "output_type": "execute_result"
680
  }
@@ -685,9 +663,18 @@
685
  },
686
  {
687
  "cell_type": "code",
688
- "execution_count": 14,
689
  "metadata": {},
690
- "outputs": [],
 
 
 
 
 
 
 
 
 
691
  "source": [
692
  "\n",
693
  "model = Sequential()\n",
@@ -698,25 +685,23 @@
698
  "\n",
699
  "model.compile(optimizer='adam', loss='mean_squared_error')\n",
700
  "\n",
701
- "checkpoint_path = \"lstm_vav_02.tf\"\n",
702
  "checkpoint_callback = ModelCheckpoint(filepath=checkpoint_path, monitor='val_loss', verbose=1, save_best_only=True, mode='min')\n",
703
- "# model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=5, batch_size=128, verbose=1, callbacks=[checkpoint_callback])"
704
  ]
705
  },
706
  {
707
  "cell_type": "code",
708
- "execution_count": 15,
709
  "metadata": {},
710
  "outputs": [
711
  {
712
- "data": {
713
- "text/plain": [
714
- "<tensorflow.python.checkpoint.checkpoint.CheckpointLoadStatus at 0x2b142b76250>"
715
- ]
716
- },
717
- "execution_count": 15,
718
- "metadata": {},
719
- "output_type": "execute_result"
720
  }
721
  ],
722
  "source": [
@@ -725,14 +710,14 @@
725
  },
726
  {
727
  "cell_type": "code",
728
- "execution_count": 16,
729
  "metadata": {},
730
  "outputs": [
731
  {
732
  "name": "stdout",
733
  "output_type": "stream",
734
  "text": [
735
- "12244/12244 [==============================] - 61s 5ms/step\n"
736
  ]
737
  }
738
  ],
@@ -742,57 +727,164 @@
742
  },
743
  {
744
  "cell_type": "code",
745
- "execution_count": 19,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
  "metadata": {},
747
  "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
748
  "source": [
749
  "%matplotlib qt\n",
750
- "plt.figure()\n",
751
- "var = 2\n",
752
- "plt.plot(y_test[:,var], label='Original Testing Data', color='blue')\n",
753
- "plt.plot(test_predict1[:,var], label='Predicted Testing Data', color='red',alpha=0.8)\n",
754
- "anomalies = np.where(abs(test_predict1[:,var] - y_test[:,var]) > 0.38)\n",
755
- "plt.scatter(anomalies,test_predict1[anomalies,var], color='black',marker =\"o\",s=100 )\n",
756
  "\n",
 
 
 
 
757
  "\n",
758
- "plt.title('Testing Data - Predicted vs Actual')\n",
759
- "plt.xlabel('Time')\n",
760
- "plt.ylabel('Value')\n",
761
- "plt.legend()\n",
762
- "plt.show()"
 
 
 
 
 
 
 
 
 
 
763
  ]
764
  },
765
  {
766
  "cell_type": "code",
767
- "execution_count": 18,
768
  "metadata": {},
769
  "outputs": [
770
  {
771
  "name": "stdout",
772
  "output_type": "stream",
773
  "text": [
774
- " 1254/33547 [>.............................] - ETA: 3:00"
775
- ]
776
- },
777
- {
778
- "ename": "KeyboardInterrupt",
779
- "evalue": "",
780
- "output_type": "error",
781
- "traceback": [
782
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
783
- "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
784
- "Cell \u001b[1;32mIn[18], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39mrun_line_magic(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmatplotlib\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mqt\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m----> 2\u001b[0m test_predict2 \u001b[38;5;241m=\u001b[39m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpredict\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX_train\u001b[49m\u001b[43m)\u001b[49m\n",
785
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\keras\\src\\utils\\traceback_utils.py:65\u001b[0m, in \u001b[0;36mfilter_traceback.<locals>.error_handler\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 63\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 64\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m---> 65\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 66\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 67\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m _process_traceback_frames(e\u001b[38;5;241m.\u001b[39m__traceback__)\n",
786
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\keras\\src\\engine\\training.py:2554\u001b[0m, in \u001b[0;36mModel.predict\u001b[1;34m(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing)\u001b[0m\n\u001b[0;32m 2552\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m step \u001b[38;5;129;01min\u001b[39;00m data_handler\u001b[38;5;241m.\u001b[39msteps():\n\u001b[0;32m 2553\u001b[0m callbacks\u001b[38;5;241m.\u001b[39mon_predict_batch_begin(step)\n\u001b[1;32m-> 2554\u001b[0m tmp_batch_outputs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpredict_function\u001b[49m\u001b[43m(\u001b[49m\u001b[43miterator\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 2555\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m data_handler\u001b[38;5;241m.\u001b[39mshould_sync:\n\u001b[0;32m 2556\u001b[0m context\u001b[38;5;241m.\u001b[39masync_wait()\n",
787
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\util\\traceback_utils.py:150\u001b[0m, in \u001b[0;36mfilter_traceback.<locals>.error_handler\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 148\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 149\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 150\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 151\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 152\u001b[0m filtered_tb \u001b[38;5;241m=\u001b[39m _process_traceback_frames(e\u001b[38;5;241m.\u001b[39m__traceback__)\n",
788
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\polymorphic_function\\polymorphic_function.py:825\u001b[0m, in \u001b[0;36mFunction.__call__\u001b[1;34m(self, *args, **kwds)\u001b[0m\n\u001b[0;32m 822\u001b[0m compiler \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mxla\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_jit_compile \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnonXla\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 824\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m OptionalXlaContext(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_jit_compile):\n\u001b[1;32m--> 825\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_call\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 827\u001b[0m new_tracing_count \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexperimental_get_tracing_count()\n\u001b[0;32m 828\u001b[0m without_tracing \u001b[38;5;241m=\u001b[39m (tracing_count \u001b[38;5;241m==\u001b[39m new_tracing_count)\n",
789
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\polymorphic_function\\polymorphic_function.py:864\u001b[0m, in \u001b[0;36mFunction._call\u001b[1;34m(self, *args, **kwds)\u001b[0m\n\u001b[0;32m 861\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lock\u001b[38;5;241m.\u001b[39mrelease()\n\u001b[0;32m 862\u001b[0m \u001b[38;5;66;03m# In this case we have not created variables on the first call. So we can\u001b[39;00m\n\u001b[0;32m 863\u001b[0m \u001b[38;5;66;03m# run the first trace but we should fail if variables are created.\u001b[39;00m\n\u001b[1;32m--> 864\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_variable_creation_fn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 865\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_created_variables \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m ALLOW_DYNAMIC_VARIABLE_CREATION:\n\u001b[0;32m 866\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCreating variables on a non-first call to a function\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 867\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m decorated with tf.function.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
790
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\polymorphic_function\\tracing_compiler.py:148\u001b[0m, in \u001b[0;36mTracingCompiler.__call__\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 145\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lock:\n\u001b[0;32m 146\u001b[0m (concrete_function,\n\u001b[0;32m 147\u001b[0m filtered_flat_args) \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_maybe_define_function(args, kwargs)\n\u001b[1;32m--> 148\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mconcrete_function\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_call_flat\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 149\u001b[0m \u001b[43m \u001b[49m\u001b[43mfiltered_flat_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcaptured_inputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconcrete_function\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcaptured_inputs\u001b[49m\u001b[43m)\u001b[49m\n",
791
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\polymorphic_function\\monomorphic_function.py:1349\u001b[0m, in \u001b[0;36mConcreteFunction._call_flat\u001b[1;34m(self, args, captured_inputs)\u001b[0m\n\u001b[0;32m 1345\u001b[0m possible_gradient_type \u001b[38;5;241m=\u001b[39m gradients_util\u001b[38;5;241m.\u001b[39mPossibleTapeGradientTypes(args)\n\u001b[0;32m 1346\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (possible_gradient_type \u001b[38;5;241m==\u001b[39m gradients_util\u001b[38;5;241m.\u001b[39mPOSSIBLE_GRADIENT_TYPES_NONE\n\u001b[0;32m 1347\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m executing_eagerly):\n\u001b[0;32m 1348\u001b[0m \u001b[38;5;66;03m# No tape is watching; skip to running the function.\u001b[39;00m\n\u001b[1;32m-> 1349\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_build_call_outputs(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_inference_function\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m 1350\u001b[0m forward_backward \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_select_forward_and_backward_functions(\n\u001b[0;32m 1351\u001b[0m args,\n\u001b[0;32m 1352\u001b[0m possible_gradient_type,\n\u001b[0;32m 1353\u001b[0m executing_eagerly)\n\u001b[0;32m 1354\u001b[0m forward_function, args_with_tangents \u001b[38;5;241m=\u001b[39m forward_backward\u001b[38;5;241m.\u001b[39mforward()\n",
792
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\polymorphic_function\\atomic_function.py:196\u001b[0m, in \u001b[0;36mAtomicFunction.__call__\u001b[1;34m(self, *args)\u001b[0m\n\u001b[0;32m 194\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m record\u001b[38;5;241m.\u001b[39mstop_recording():\n\u001b[0;32m 195\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_bound_context\u001b[38;5;241m.\u001b[39mexecuting_eagerly():\n\u001b[1;32m--> 196\u001b[0m outputs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_bound_context\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcall_function\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 197\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 198\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mlist\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 199\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfunction_type\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mflat_outputs\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 200\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 201\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 202\u001b[0m outputs \u001b[38;5;241m=\u001b[39m make_call_op_in_graph(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;28mlist\u001b[39m(args))\n",
793
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\context.py:1457\u001b[0m, in \u001b[0;36mContext.call_function\u001b[1;34m(self, name, tensor_inputs, num_outputs)\u001b[0m\n\u001b[0;32m 1455\u001b[0m cancellation_context \u001b[38;5;241m=\u001b[39m cancellation\u001b[38;5;241m.\u001b[39mcontext()\n\u001b[0;32m 1456\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cancellation_context \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m-> 1457\u001b[0m outputs \u001b[38;5;241m=\u001b[39m \u001b[43mexecute\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 1458\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mutf-8\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1459\u001b[0m \u001b[43m \u001b[49m\u001b[43mnum_outputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnum_outputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1460\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtensor_inputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1461\u001b[0m \u001b[43m \u001b[49m\u001b[43mattrs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mattrs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1462\u001b[0m \u001b[43m \u001b[49m\u001b[43mctx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1463\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 1464\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 1465\u001b[0m outputs \u001b[38;5;241m=\u001b[39m execute\u001b[38;5;241m.\u001b[39mexecute_with_cancellation(\n\u001b[0;32m 1466\u001b[0m name\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mutf-8\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[0;32m 1467\u001b[0m num_outputs\u001b[38;5;241m=\u001b[39mnum_outputs,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1471\u001b[0m cancellation_manager\u001b[38;5;241m=\u001b[39mcancellation_context,\n\u001b[0;32m 1472\u001b[0m )\n",
794
- "File \u001b[1;32md:\\Programs\\minconda3\\envs\\smartbuildings\\Lib\\site-packages\\tensorflow\\python\\eager\\execute.py:53\u001b[0m, in \u001b[0;36mquick_execute\u001b[1;34m(op_name, num_outputs, inputs, attrs, ctx, name)\u001b[0m\n\u001b[0;32m 51\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 52\u001b[0m ctx\u001b[38;5;241m.\u001b[39mensure_initialized()\n\u001b[1;32m---> 53\u001b[0m tensors \u001b[38;5;241m=\u001b[39m \u001b[43mpywrap_tfe\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mTFE_Py_Execute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mctx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_handle\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdevice_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mop_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 54\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mattrs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnum_outputs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 55\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m core\u001b[38;5;241m.\u001b[39m_NotOkStatusException \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 56\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m name \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
795
- "\u001b[1;31mKeyboardInterrupt\u001b[0m: "
796
  ]
797
  }
798
  ],
@@ -804,12 +896,12 @@
804
  },
805
  {
806
  "cell_type": "code",
807
- "execution_count": null,
808
  "metadata": {},
809
  "outputs": [],
810
  "source": [
811
  "plt.figure()\n",
812
- "var = 3\n",
813
  "plt.plot(y_train[:,var], label='Original Training Data', color='blue')\n",
814
  "plt.plot(test_predict2[:,var], label='Predicted Training Data', color='red',alpha=0.8)\n",
815
  "anomalies = np.where(abs(test_predict2[:,var] - y_train[:,var]) > 0.38)\n",
@@ -863,7 +955,7 @@
863
  },
864
  {
865
  "cell_type": "code",
866
- "execution_count": 22,
867
  "metadata": {},
868
  "outputs": [],
869
  "source": [
@@ -876,34 +968,36 @@
876
  "np.random.seed(0)\n",
877
  "X = (test_predict1 - y_test)\n",
878
  "\n",
879
- "k = 6\n",
 
 
 
880
  "\n",
881
  "kmeans = KMeans(n_clusters=k)\n",
882
  "\n",
883
  "kmeans.fit(X)\n",
884
  "\n",
885
- "pca = PCA(n_components=2)\n",
886
- "X = pca.fit_transform(X)\n",
887
- "\n",
888
  "\n",
889
  "\n",
890
  "# Getting the cluster centers and labels\n",
891
  "centroids = kmeans.cluster_centers_\n",
892
- "centroids = pca.transform(centroids)\n",
893
  "labels = kmeans.labels_\n",
894
  "\n",
895
  "# Plotting the data points and cluster centers\n",
896
  "plt.scatter(X[:, 0], X[:, 1], c=labels, cmap='viridis', alpha=0.5)\n",
897
  "plt.scatter(centroids[:, 0], centroids[:, 1], marker='x', c='red', s=200, linewidths=2)\n",
 
 
898
  "plt.title('KMeans Clustering')\n",
899
  "plt.xlabel('Feature 1')\n",
900
  "plt.ylabel('Feature 2')\n",
901
- "plt.show()\n"
902
  ]
903
  },
904
  {
905
  "cell_type": "code",
906
- "execution_count": 20,
907
  "metadata": {},
908
  "outputs": [],
909
  "source": [
@@ -924,7 +1018,7 @@
924
  },
925
  {
926
  "cell_type": "code",
927
- "execution_count": 23,
928
  "metadata": {},
929
  "outputs": [],
930
  "source": [
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 31,
6
  "metadata": {},
7
  "outputs": [],
8
  "source": [
 
17
  "from sklearn.model_selection import train_test_split\n",
18
  "from sklearn.preprocessing import MinMaxScaler,StandardScaler\n",
19
  "from keras.callbacks import ModelCheckpoint\n",
20
+ "import tensorflow as tf\n",
21
+ "import joblib\n",
22
+ "from datetime import datetime"
23
  ]
24
  },
25
  {
 
72
  "name": "stderr",
73
  "output_type": "stream",
74
  "text": [
75
+ "C:\\Users\\arbal\\AppData\\Local\\Temp\\ipykernel_18672\\1855433847.py:1: SettingWithCopyWarning: \n",
76
  "A value is trying to be set on a copy of a slice from a DataFrame.\n",
77
  "Try using .loc[row_indexer,col_indexer] = value instead\n",
78
  "\n",
 
530
  ],
531
  "source": [
532
  "testdataset_df = df_filtered[(df_filtered.date.dt.date >date(2020, 3, 1)) & (df_filtered.date.dt.date <date(2020,7, 1))]\n",
533
+ "testdataset_df.set_index('date', inplace=True)\n",
534
  "# traindataset_df = df_filtered[ (df_filtered.date.dt.date >date(2019, 11, 8))]\n",
535
  "\n",
536
  "traindataset_df = df_filtered[(df_filtered.date.dt.date >date(2019, 3, 1)) & (df_filtered.date.dt.date <date(2020, 3, 1)) | (df_filtered.date.dt.date >date(2020, 7, 1)) & (df_filtered.date.dt.date <date(2020, 12, 1))]\n",
 
575
  "cell_type": "code",
576
  "execution_count": 8,
577
  "metadata": {},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
  "outputs": [
579
  {
580
  "data": {
 
582
  "(1073512, 391818)"
583
  ]
584
  },
585
+ "execution_count": 8,
586
  "metadata": {},
587
  "output_type": "execute_result"
588
  }
 
593
  },
594
  {
595
  "cell_type": "code",
596
+ "execution_count": 9,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
  "metadata": {},
598
  "outputs": [
599
  {
600
  "data": {
601
  "text/plain": [
602
+ "['scaler_vav_2.pkl']"
603
  ]
604
  },
605
+ "execution_count": 9,
606
  "metadata": {},
607
  "output_type": "execute_result"
608
  }
609
  ],
610
  "source": [
611
+ "traindataset = traindataset.astype('float32')\n",
612
+ "testdataset = testdataset.astype('float32')\n",
613
+ "\n",
614
+ "scaler = StandardScaler()\n",
615
+ "traindataset = scaler.fit_transform(traindataset)\n",
616
+ "testdataset = scaler.transform(testdataset)\n",
617
+ "\n",
618
+ "joblib.dump(scaler, 'scaler_vav_2.pkl')"
619
  ]
620
  },
621
  {
622
  "cell_type": "code",
623
+ "execution_count": 136,
624
  "metadata": {},
625
  "outputs": [],
626
  "source": [
 
643
  },
644
  {
645
  "cell_type": "code",
646
+ "execution_count": 11,
647
  "metadata": {},
648
  "outputs": [
649
  {
 
652
  "((1073481, 30, 55), (1073481, 31))"
653
  ]
654
  },
655
+ "execution_count": 11,
656
  "metadata": {},
657
  "output_type": "execute_result"
658
  }
 
663
  },
664
  {
665
  "cell_type": "code",
666
+ "execution_count": 12,
667
  "metadata": {},
668
+ "outputs": [
669
+ {
670
+ "name": "stderr",
671
+ "output_type": "stream",
672
+ "text": [
673
+ "d:\\anaconda3\\envs\\smartbuilding\\Lib\\site-packages\\keras\\src\\layers\\rnn\\rnn.py:204: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
674
+ " super().__init__(**kwargs)\n"
675
+ ]
676
+ }
677
+ ],
678
  "source": [
679
  "\n",
680
  "model = Sequential()\n",
 
685
  "\n",
686
  "model.compile(optimizer='adam', loss='mean_squared_error')\n",
687
  "\n",
688
+ "checkpoint_path = \"lstm_vav_02.keras\"\n",
689
  "checkpoint_callback = ModelCheckpoint(filepath=checkpoint_path, monitor='val_loss', verbose=1, save_best_only=True, mode='min')\n",
690
+ "# model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=3, batch_size=128, verbose=1, callbacks=[checkpoint_callback])"
691
  ]
692
  },
693
  {
694
  "cell_type": "code",
695
+ "execution_count": 13,
696
  "metadata": {},
697
  "outputs": [
698
  {
699
+ "name": "stderr",
700
+ "output_type": "stream",
701
+ "text": [
702
+ "d:\\anaconda3\\envs\\smartbuilding\\Lib\\site-packages\\keras\\src\\saving\\saving_lib.py:415: UserWarning: Skipping variable loading for optimizer 'adam', because it has 2 variables whereas the saved optimizer has 24 variables. \n",
703
+ " saveable.load_own_variables(weights_store.get(inner_path))\n"
704
+ ]
 
 
705
  }
706
  ],
707
  "source": [
 
710
  },
711
  {
712
  "cell_type": "code",
713
+ "execution_count": 129,
714
  "metadata": {},
715
  "outputs": [
716
  {
717
  "name": "stdout",
718
  "output_type": "stream",
719
  "text": [
720
+ "\u001b[1m12244/12244\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m71s\u001b[0m 6ms/step\n"
721
  ]
722
  }
723
  ],
 
727
  },
728
  {
729
  "cell_type": "code",
730
+ "execution_count": 130,
731
+ "metadata": {},
732
+ "outputs": [
733
+ {
734
+ "data": {
735
+ "text/plain": [
736
+ "{0: 'zone_072_temp',\n",
737
+ " 1: 'zone_072_fan_spd',\n",
738
+ " 2: 'zone_071_temp',\n",
739
+ " 3: 'zone_071_fan_spd',\n",
740
+ " 4: 'zone_063_temp',\n",
741
+ " 5: 'zone_063_fan_spd',\n",
742
+ " 6: 'zone_062_temp',\n",
743
+ " 7: 'zone_062_fan_spd',\n",
744
+ " 8: 'zone_059_temp',\n",
745
+ " 9: 'zone_059_fan_spd',\n",
746
+ " 10: 'zone_058_temp',\n",
747
+ " 11: 'zone_058_fan_spd',\n",
748
+ " 12: 'zone_057_temp',\n",
749
+ " 13: 'zone_057_fan_spd',\n",
750
+ " 14: 'zone_049_temp',\n",
751
+ " 15: 'zone_049_fan_spd',\n",
752
+ " 16: 'zone_044_temp',\n",
753
+ " 17: 'zone_044_fan_spd',\n",
754
+ " 18: 'zone_043_temp',\n",
755
+ " 19: 'zone_043_fan_spd',\n",
756
+ " 20: 'zone_035_temp',\n",
757
+ " 21: 'zone_035_fan_spd',\n",
758
+ " 22: 'zone_033_temp',\n",
759
+ " 23: 'zone_033_fan_spd',\n",
760
+ " 24: 'zone_032_temp',\n",
761
+ " 25: 'zone_032_fan_spd',\n",
762
+ " 26: 'zone_030_temp',\n",
763
+ " 27: 'zone_030_fan_spd',\n",
764
+ " 28: 'zone_028_temp',\n",
765
+ " 29: 'zone_028_fan_spd',\n",
766
+ " 30: 'zone_071_cooling_sp',\n",
767
+ " 31: 'zone_071_heating_sp',\n",
768
+ " 32: 'zone_063_cooling_sp',\n",
769
+ " 33: 'zone_063_heating_sp',\n",
770
+ " 34: 'zone_062_cooling_sp',\n",
771
+ " 35: 'zone_062_heating_sp',\n",
772
+ " 36: 'zone_059_cooling_sp',\n",
773
+ " 37: 'zone_059_heating_sp',\n",
774
+ " 38: 'zone_057_cooling_sp',\n",
775
+ " 39: 'zone_057_heating_sp',\n",
776
+ " 40: 'zone_049_cooling_sp',\n",
777
+ " 41: 'zone_049_heating_sp',\n",
778
+ " 42: 'zone_043_cooling_sp',\n",
779
+ " 43: 'zone_043_heating_sp',\n",
780
+ " 44: 'zone_035_cooling_sp',\n",
781
+ " 45: 'zone_035_heating_sp',\n",
782
+ " 46: 'zone_032_cooling_sp',\n",
783
+ " 47: 'zone_032_heating_sp',\n",
784
+ " 48: 'zone_030_cooling_sp',\n",
785
+ " 49: 'zone_030_heating_sp',\n",
786
+ " 50: 'air_temp_set_1',\n",
787
+ " 51: 'air_temp_set_2',\n",
788
+ " 52: 'dew_point_temperature_set_1d',\n",
789
+ " 53: 'relative_humidity_set_1',\n",
790
+ " 54: 'solar_radiation_set_1'}"
791
+ ]
792
+ },
793
+ "execution_count": 130,
794
+ "metadata": {},
795
+ "output_type": "execute_result"
796
+ }
797
+ ],
798
+ "source": [
799
+ "idx_2_col = {}\n",
800
+ "for i, col in enumerate(traindataset_df.columns[1:]):\n",
801
+ " idx_2_col[i] = col\n",
802
+ "\n",
803
+ "idx_2_col"
804
+ ]
805
+ },
806
+ {
807
+ "cell_type": "code",
808
+ "execution_count": 131,
809
+ "metadata": {},
810
+ "outputs": [
811
+ {
812
+ "data": {
813
+ "text/plain": [
814
+ "(391787, 31)"
815
+ ]
816
+ },
817
+ "execution_count": 131,
818
+ "metadata": {},
819
+ "output_type": "execute_result"
820
+ }
821
+ ],
822
+ "source": [
823
+ "test_predict1.shape"
824
+ ]
825
+ },
826
+ {
827
+ "cell_type": "code",
828
+ "execution_count": 143,
829
  "metadata": {},
830
  "outputs": [],
831
+ "source": [
832
+ "test_predict1_unscaled = test_predict1*scaler.scale_[0:31] + scaler.mean_[0:31]\n",
833
+ "y_test_unscaled = y_test*scaler.scale_[0:31] + scaler.mean_[0:31]"
834
+ ]
835
+ },
836
+ {
837
+ "cell_type": "code",
838
+ "execution_count": 148,
839
+ "metadata": {},
840
+ "outputs": [
841
+ {
842
+ "name": "stderr",
843
+ "output_type": "stream",
844
+ "text": [
845
+ "d:\\anaconda3\\envs\\smartbuilding\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:7588: FutureWarning: Dtype inference on a pandas object (Series, Index, ExtensionArray) is deprecated. The Index constructor will keep the original dtype in the future. Call `infer_objects` on the result to get the old behavior.\n",
846
+ " return Index(sequences[0], name=names)\n",
847
+ "d:\\anaconda3\\envs\\smartbuilding\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:7588: FutureWarning: Dtype inference on a pandas object (Series, Index, ExtensionArray) is deprecated. The Index constructor will keep the original dtype in the future. Call `infer_objects` on the result to get the old behavior.\n",
848
+ " return Index(sequences[0], name=names)\n"
849
+ ]
850
+ }
851
+ ],
852
  "source": [
853
  "%matplotlib qt\n",
854
+ "var = 0\n",
 
 
 
 
 
855
  "\n",
856
+ "df = pd.DataFrame([testdataset_df.index[31:],test_predict1_unscaled[:,var], y_test_unscaled[:,var]] ).T\n",
857
+ "fig, ax = plt.subplots(figsize=(20,15), dpi = 600)\n",
858
+ "df.plot(x = 0, y=1, ax = ax, label = 'Predicted')\n",
859
+ "df.plot(x = 0, y=2, ax = ax, label = 'Actual')\n",
860
  "\n",
861
+ "anomalies = df.where(df[1]-df[2]>0.38)[0]\n",
862
+ "df['anomalies'] = anomalies\n",
863
+ "\n",
864
+ "df_new = df.dropna()\n",
865
+ "\n",
866
+ "df_new.plot.scatter(x='anomalies', y=1, c='r', ax = ax, label = 'Anomalies')\n",
867
+ "\n",
868
+ "# ax.scatter(anomalies,test_predict1[anomalies,var], color='black',marker =\"o\",s=100 )\n",
869
+ "\n",
870
+ "\n",
871
+ "ax.set_title('Testing Data - Predicted vs Actual [Zone 72 Temperature]')\n",
872
+ "ax.set_xlabel('Time')\n",
873
+ "ax.set_ylabel('Value')\n",
874
+ "ax.legend()\n",
875
+ "fig.tight_layout()"
876
  ]
877
  },
878
  {
879
  "cell_type": "code",
880
+ "execution_count": 114,
881
  "metadata": {},
882
  "outputs": [
883
  {
884
  "name": "stdout",
885
  "output_type": "stream",
886
  "text": [
887
+ "\u001b[1m33547/33547\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m308s\u001b[0m 9ms/step\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
888
  ]
889
  }
890
  ],
 
896
  },
897
  {
898
  "cell_type": "code",
899
+ "execution_count": 117,
900
  "metadata": {},
901
  "outputs": [],
902
  "source": [
903
  "plt.figure()\n",
904
+ "var = 0\n",
905
  "plt.plot(y_train[:,var], label='Original Training Data', color='blue')\n",
906
  "plt.plot(test_predict2[:,var], label='Predicted Training Data', color='red',alpha=0.8)\n",
907
  "anomalies = np.where(abs(test_predict2[:,var] - y_train[:,var]) > 0.38)\n",
 
955
  },
956
  {
957
  "cell_type": "code",
958
+ "execution_count": 156,
959
  "metadata": {},
960
  "outputs": [],
961
  "source": [
 
968
  "np.random.seed(0)\n",
969
  "X = (test_predict1 - y_test)\n",
970
  "\n",
971
+ "k = 2\n",
972
+ "\n",
973
+ "pca = PCA(n_components=2)\n",
974
+ "X = pca.fit_transform(X)\n",
975
  "\n",
976
  "kmeans = KMeans(n_clusters=k)\n",
977
  "\n",
978
  "kmeans.fit(X)\n",
979
  "\n",
 
 
 
980
  "\n",
981
  "\n",
982
  "# Getting the cluster centers and labels\n",
983
  "centroids = kmeans.cluster_centers_\n",
984
+ "# centroids = pca.transform(centroids)\n",
985
  "labels = kmeans.labels_\n",
986
  "\n",
987
  "# Plotting the data points and cluster centers\n",
988
  "plt.scatter(X[:, 0], X[:, 1], c=labels, cmap='viridis', alpha=0.5)\n",
989
  "plt.scatter(centroids[:, 0], centroids[:, 1], marker='x', c='red', s=200, linewidths=2)\n",
990
+ "plt.text(centroids[0,0]+0.2, centroids[0,1]+0.3, 'Normal', fontsize=12, color='red')\n",
991
+ "plt.text(centroids[1,0]+0.5, centroids[1,1], 'Anomaly', fontsize=12, color='red')\n",
992
  "plt.title('KMeans Clustering')\n",
993
  "plt.xlabel('Feature 1')\n",
994
  "plt.ylabel('Feature 2')\n",
995
+ "plt.tight_layout()\n"
996
  ]
997
  },
998
  {
999
  "cell_type": "code",
1000
+ "execution_count": null,
1001
  "metadata": {},
1002
  "outputs": [],
1003
  "source": [
 
1018
  },
1019
  {
1020
  "cell_type": "code",
1021
+ "execution_count": null,
1022
  "metadata": {},
1023
  "outputs": [],
1024
  "source": [
physLSTM/scaler_vav_2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12522c4935877d8dedeb1fe60b577a93c64d864ff6292960cf5fcd85ffc342e1
3
+ size 1925