Csar Fdez 1 місяць тому
джерело
коміт
85b74f953f
1 змінених файлів з 13 додано та 4 видалено
  1. 13
    4
      v2_unsupervised.py

+ 13
- 4
v2_unsupervised.py Переглянути файл

@@ -23,7 +23,8 @@ from collections import Counter
23 23
 parser = OptionParser()
24 24
 parser.add_option("-t", "--train", dest="train", help="Trains the models (false)", default=False, action="store_true")
25 25
 parser.add_option("-p", "--plot", dest="plot", help="Plot Data (false)", default=False, action="store_true")
26
-parser.add_option("-n", "--timesteps", dest="timesteps", help="TIME STEPS ", default=12)
26
+parser.add_option("-n", "--timesteps", dest="timesteps", help="TIME STEPS (default 12)", default=12)
27
+parser.add_option("-f", "--facilitysetpoint", dest="fsp", help="Facility and Set Point (default 5-26)", default="5-26")
27 28
 
28 29
 (options, args) = parser.parse_args()
29 30
 
@@ -35,6 +36,7 @@ parser.add_option("-n", "--timesteps", dest="timesteps", help="TIME STEPS ", def
35 36
 # 3   Fan condenser not working
36 37
 # 4.  Open door
37 38
 
39
+FailureName=['No Fail','Block Evap', 'Block Cond', 'Not Fan Cond', 'Open Door']
38 40
 
39 41
 NumberOfFailures=4  
40 42
 datafiles={}
@@ -101,7 +103,7 @@ datafiles['34'][4]=['2025-04-23_3_','2025-04-24_3_','2025-04-25_3_']
101 103
 # 4.  Open door
102 104
 
103 105
 
104
-facilitySetpoint='5-18'
106
+facilitySetpoint=options.fsp
105 107
 # Features suggested by Xavier
106 108
 # Care with 'tc s3' because on datafiles[0] is always nulll
107 109
 # Seems to be incoropored in new tests
@@ -113,8 +115,8 @@ facilitySetpoint='5-18'
113 115
 # VAriables r1s4 and pa1 apiii  may not exists in cloud controlers
114 116
 
115 117
 
116
-features=['r1 s1','r1 s4','r1 s5','pa1 apiii']
117
-#features=['r1 s1','r1 s4','r1 s5']
118
+#features=['r1 s1','r1 s4','r1 s5','pa1 apiii']
119
+features=['r1 s1','r1 s4','r1 s5']
118 120
 featureNames={}
119 121
 featureNames['r1 s1']='$T_{evap}$'
120 122
 featureNames['r1 s4']='$T_{cond}$'
@@ -202,6 +204,13 @@ def plotData():
202 204
     for i in range(NumberOfFailures+1):
203 205
         for  j in range(NumFeatures):
204 206
             axes[i][j].plot(np.concatenate((dataTrainNorm[i][:,j],dataTestNorm[i][:,j])),label="Fail "+str(i)+",  feature 0")
207
+            if i==(NumberOfFailures):
208
+                axes[i][j].set_xlabel(features[j])
209
+            if j==0:
210
+                axes[i][j].set_ylabel(FailureName[i])
211
+
212
+
213
+
205 214
     #axes[1].legend()
206 215
     #axes[0].set_ylabel(features[0])
207 216
     #axes[1].set_ylabel(features[1])

Powered by TurnKey Linux.