Csar Fdez 1 month ago
parent
commit
85b74f953f
1 changed files with 13 additions and 4 deletions
  1. 13
    4
      v2_unsupervised.py

+ 13
- 4
v2_unsupervised.py View File

23
 parser = OptionParser()
23
 parser = OptionParser()
24
 parser.add_option("-t", "--train", dest="train", help="Trains the models (false)", default=False, action="store_true")
24
 parser.add_option("-t", "--train", dest="train", help="Trains the models (false)", default=False, action="store_true")
25
 parser.add_option("-p", "--plot", dest="plot", help="Plot Data (false)", default=False, action="store_true")
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
 (options, args) = parser.parse_args()
29
 (options, args) = parser.parse_args()
29
 
30
 
35
 # 3   Fan condenser not working
36
 # 3   Fan condenser not working
36
 # 4.  Open door
37
 # 4.  Open door
37
 
38
 
39
+FailureName=['No Fail','Block Evap', 'Block Cond', 'Not Fan Cond', 'Open Door']
38
 
40
 
39
 NumberOfFailures=4  
41
 NumberOfFailures=4  
40
 datafiles={}
42
 datafiles={}
101
 # 4.  Open door
103
 # 4.  Open door
102
 
104
 
103
 
105
 
104
-facilitySetpoint='5-18'
106
+facilitySetpoint=options.fsp
105
 # Features suggested by Xavier
107
 # Features suggested by Xavier
106
 # Care with 'tc s3' because on datafiles[0] is always nulll
108
 # Care with 'tc s3' because on datafiles[0] is always nulll
107
 # Seems to be incoropored in new tests
109
 # Seems to be incoropored in new tests
113
 # VAriables r1s4 and pa1 apiii  may not exists in cloud controlers
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
 featureNames={}
120
 featureNames={}
119
 featureNames['r1 s1']='$T_{evap}$'
121
 featureNames['r1 s1']='$T_{evap}$'
120
 featureNames['r1 s4']='$T_{cond}$'
122
 featureNames['r1 s4']='$T_{cond}$'
202
     for i in range(NumberOfFailures+1):
204
     for i in range(NumberOfFailures+1):
203
         for  j in range(NumFeatures):
205
         for  j in range(NumFeatures):
204
             axes[i][j].plot(np.concatenate((dataTrainNorm[i][:,j],dataTestNorm[i][:,j])),label="Fail "+str(i)+",  feature 0")
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
     #axes[1].legend()
214
     #axes[1].legend()
206
     #axes[0].set_ylabel(features[0])
215
     #axes[0].set_ylabel(features[0])
207
     #axes[1].set_ylabel(features[1])
216
     #axes[1].set_ylabel(features[1])

Powered by TurnKey Linux.