kirchoof commited on
Commit
197f894
1 Parent(s): 6d7b1dc

Upload 3 files

Browse files

![Telecom Machine learning app.png](https://s3.amazonaws.com/moonup/production/uploads/1675423852049-63dcdf5322cc06e76a84d6c6.png)

Files changed (3) hide show
  1. RSL_copy.csv +379 -0
  2. app.py +59 -0
  3. trained_lrmodel.sav +0 -0
RSL_copy.csv ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ terminal _A_ site_ RSl,Hub_B_site_RSL,outcome
2
+ -44,-71,1
3
+ -53,-69,1
4
+ -52,-70,1
5
+ -47,-51,1
6
+ -55,-72,1
7
+ -32,-33,0
8
+ -88,-81,6
9
+ -46,-51,1
10
+ 0,-88,2
11
+ 0,0,4
12
+ -45,-80,1
13
+ -63,-69,1
14
+ 0,-76,2
15
+ 0,0,4
16
+ -23,-31,5
17
+ -82,-90,6
18
+ -54,-61,1
19
+ -21,-35,5
20
+ -52,-62,1
21
+ 0,-33,3
22
+ -54,-48,1
23
+ -46,-64,1
24
+ 0,-32,3
25
+ -76,-54,1
26
+ -76,-53,1
27
+ -73,-66,1
28
+ -33,-30,0
29
+ -31,-38,0
30
+ -60,-52,1
31
+ -33,-38,0
32
+ -26,-39,5
33
+ -71,-58,1
34
+ -45,-70,1
35
+ 0,0,4
36
+ -51,-78,1
37
+ -80,-52,1
38
+ -79,-47,1
39
+ 0,0,4
40
+ -62,-62,1
41
+ 0,0,4
42
+ -62,-51,1
43
+ -62,-73,1
44
+ -52,-43,1
45
+ 0,-38,3
46
+ -43,-41,1
47
+ 0,-83,2
48
+ 0,-34,3
49
+ -63,-42,1
50
+ 0,0,4
51
+ -51,-80,1
52
+ -46,-66,1
53
+ 0,-40,3
54
+ -46,-78,1
55
+ -75,-64,1
56
+ 0,-90,2
57
+ -45,-45,1
58
+ 0,-78,2
59
+ -61,-68,1
60
+ 0,-39,3
61
+ 0,0,4
62
+ -39,-30,0
63
+ -50,-48,1
64
+ -72,-71,1
65
+ -73,-73,1
66
+ -48,-49,1
67
+ -74,-54,1
68
+ -24,-38,5
69
+ -38,-36,0
70
+ 0,-40,3
71
+ -45,-75,1
72
+ -53,-68,1
73
+ -53,-47,1
74
+ -41,-33,0
75
+ -28,-37,5
76
+ -78,-72,1
77
+ 0,-40,3
78
+ -21,-30,5
79
+ -67,-73,1
80
+ -80,-88,6
81
+ -75,-80,1
82
+ -76,-60,1
83
+ -87,-88,6
84
+ -61,-77,1
85
+ -68,-53,1
86
+ -50,-64,1
87
+ -68,-79,1
88
+ 0,-77,2
89
+ -83,-84,6
90
+ 0,-39,3
91
+ -23,-36,5
92
+ -54,-44,1
93
+ 0,0,4
94
+ -24,-30,5
95
+ 0,-80,2
96
+ -78,-63,1
97
+ 0,0,4
98
+ -49,-73,1
99
+ 0,0,4
100
+ -22,-38,5
101
+ 0,-35,3
102
+ -50,-43,1
103
+ -44,-72,1
104
+ 0,-32,3
105
+ -55,-78,1
106
+ -78,-59,1
107
+ -83,-87,6
108
+ -41,-46,1
109
+ -75,-56,1
110
+ -46,-66,1
111
+ 0,0,4
112
+ -42,-55,1
113
+ 0,-30,3
114
+ -71,-70,1
115
+ -67,-74,1
116
+ -74,-71,1
117
+ -77,-74,1
118
+ 0,-37,3
119
+ -37,-37,0
120
+ 0,-36,3
121
+ -80,-79,1
122
+ 0,-84,2
123
+ 0,-82,2
124
+ -52,-74,1
125
+ -48,-66,1
126
+ -61,-55,1
127
+ -37,-33,0
128
+ 0,0,4
129
+ 0,-82,2
130
+ 0,-81,2
131
+ -70,-72,1
132
+ -59,-41,1
133
+ -78,-66,1
134
+ 0,0,4
135
+ 0,-88,2
136
+ -56,-48,1
137
+ 0,0,4
138
+ 0,-81,2
139
+ 0,0,4
140
+ 0,0,4
141
+ 0,-37,3
142
+ 0,-79,2
143
+ 0,-80,2
144
+ 0,0,4
145
+ 0,-31,3
146
+ -66,-51,1
147
+ -52,-69,1
148
+ 0,0,4
149
+ -48,-79,1
150
+ -72,-62,1
151
+ -44,-55,1
152
+ 0,-36,3
153
+ 0,-78,2
154
+ 0,-89,2
155
+ -73,-45,1
156
+ -48,-75,1
157
+ -41,-45,1
158
+ 0,-81,2
159
+ -77,-43,1
160
+ 0,-89,2
161
+ -61,-79,1
162
+ -78,-43,1
163
+ -56,-57,1
164
+ -61,-73,1
165
+ -67,-53,1
166
+ -56,-69,1
167
+ 0,-81,2
168
+ -74,-65,1
169
+ 0,0,4
170
+ 0,-39,3
171
+ 0,0,4
172
+ -58,-51,1
173
+ -76,-60,1
174
+ 0,-33,3
175
+ 0,-84,2
176
+ 0,-89,2
177
+ -70,-73,1
178
+ -69,-61,1
179
+ -44,-77,1
180
+ -73,-77,1
181
+ -70,-63,1
182
+ -47,-55,1
183
+ -61,-46,1
184
+ -65,-78,1
185
+ -41,-31,0
186
+ 0,-32,3
187
+ 0,0,4
188
+ -45,-65,1
189
+ 0,0,4
190
+ 0,-41,3
191
+ -23,-35,5
192
+ 0,0,4
193
+ 0,0,4
194
+ -75,-61,1
195
+ 0,0,4
196
+ 0,0,4
197
+ -77,-73,1
198
+ -75,-79,1
199
+ -85,-89,6
200
+ -47,-70,1
201
+ -73,-55,1
202
+ 0,-78,2
203
+ -38,-37,0
204
+ 0,-79,2
205
+ 0,0,4
206
+ -67,-66,1
207
+ 0,0,4
208
+ -22,-35,5
209
+ 0,-86,2
210
+ -77,-77,1
211
+ -57,-48,1
212
+ -53,-58,1
213
+ -43,-52,1
214
+ 0,0,4
215
+ -47,-46,1
216
+ -56,-69,1
217
+ -79,-51,1
218
+ 0,0,4
219
+ 0,-79,2
220
+ 0,-85,2
221
+ 0,0,4
222
+ -37,-30,0
223
+ -57,-79,1
224
+ -73,-57,1
225
+ -75,-66,1
226
+ -60,-53,1
227
+ -43,-71,1
228
+ 0,-90,2
229
+ -58,-48,1
230
+ -54,-58,1
231
+ -61,-43,1
232
+ -50,-48,1
233
+ 0,0,4
234
+ -65,-66,1
235
+ -22,-39,5
236
+ -79,-53,1
237
+ -59,-51,1
238
+ -48,-48,1
239
+ -49,-42,1
240
+ -76,-54,1
241
+ -58,-63,1
242
+ 0,-31,3
243
+ -73,-54,1
244
+ -30,-41,0
245
+ -32,-30,0
246
+ -57,-50,1
247
+ 0,-30,3
248
+ 0,0,4
249
+ -52,-75,1
250
+ -50,-71,1
251
+ 0,-82,2
252
+ 0,0,4
253
+ 0,-34,3
254
+ 0,-32,3
255
+ -51,-47,1
256
+ -75,-66,1
257
+ -26,-35,5
258
+ 0,-86,2
259
+ -78,-46,1
260
+ 0,-32,3
261
+ -33,-39,0
262
+ -61,-53,1
263
+ 0,-36,3
264
+ -81,-84,6
265
+ -22,-30,5
266
+ -64,-77,1
267
+ -59,-71,1
268
+ -39,-30,0
269
+ -89,-82,6
270
+ 0,-35,3
271
+ -66,-79,1
272
+ 0,0,4
273
+ -27,-36,5
274
+ -22,-33,5
275
+ 0,-32,3
276
+ 0,-34,3
277
+ 0,0,4
278
+ -73,-50,1
279
+ -75,-64,1
280
+ 0,0,4
281
+ -69,-60,1
282
+ -24,-31,5
283
+ -67,-75,1
284
+ 0,-90,2
285
+ -41,-60,1
286
+ -55,-48,1
287
+ -70,-48,1
288
+ -44,-75,1
289
+ 0,0,4
290
+ -41,-73,1
291
+ -41,-66,1
292
+ -68,-67,1
293
+ 0,0,4
294
+ 0,0,4
295
+ -61,-55,1
296
+ -52,-74,1
297
+ -37,-30,0
298
+ 0,0,4
299
+ 0,-37,3
300
+ -41,-36,0
301
+ -70,-54,1
302
+ -51,-47,1
303
+ 0,-86,2
304
+ -55,-48,1
305
+ 0,-30,3
306
+ -38,-38,0
307
+ -65,-63,1
308
+ 0,-82,2
309
+ -60,-43,1
310
+ 0,0,4
311
+ -54,-52,1
312
+ -54,-74,1
313
+ -83,-88,6
314
+ -66,-47,1
315
+ -66,-63,1
316
+ 0,-76,2
317
+ 0,-39,3
318
+ 0,0,4
319
+ -20,-36,5
320
+ -84,-89,6
321
+ -56,-63,1
322
+ -58,-52,1
323
+ 0,-77,2
324
+ -53,-75,1
325
+ -75,-61,1
326
+ -32,-30,0
327
+ -22,-39,5
328
+ 0,0,4
329
+ -78,-76,1
330
+ 0,0,4
331
+ -41,-71,1
332
+ -49,-56,1
333
+ -59,-75,1
334
+ 0,0,4
335
+ -32,-31,0
336
+ -51,-42,1
337
+ -44,-72,1
338
+ -22,-34,5
339
+ -76,-71,1
340
+ -64,-57,1
341
+ 0,-75,2
342
+ 0,0,4
343
+ 0,-84,2
344
+ 0,0,4
345
+ -76,-47,1
346
+ -68,-78,1
347
+ -68,-48,1
348
+ -77,-63,1
349
+ -54,-70,1
350
+ 0,-83,2
351
+ -75,-70,1
352
+ -34,-39,0
353
+ -32,-39,0
354
+ -70,-54,1
355
+ -54,-42,1
356
+ -72,-44,1
357
+ -48,-72,1
358
+ -63,-48,1
359
+ -76,-70,1
360
+ 0,0,4
361
+ -67,-43,1
362
+ 0,-84,2
363
+ 0,0,4
364
+ -43,-55,1
365
+ -37,-38,0
366
+ -31,-37,0
367
+ -64,-45,1
368
+ -80,-61,1
369
+ 0,-81,2
370
+ -51,-56,1
371
+ -71,-73,1
372
+ -53,-44,1
373
+ -56,-60,1
374
+ -56,-61,1
375
+ -48,-54,1
376
+ -38,-33,0
377
+ 0,-33,3
378
+ 0,-82,2
379
+ -69,-71,1
app.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit
2
+ import pickle
3
+ import numpy
4
+ import sklearn
5
+ # web app on your desktop local host
6
+ #run on your pycharm terminal ' streamlit run app.py '
7
+ # if using command window ensure the path is correct.. c:\users\idom...\pycharm..\machin learing>
8
+ # that is pionting to your python file
9
+ loaded_model = pickle.load(open('trained_lrmodel.sav','rb'))
10
+ #create function to handle predicition
11
+ def microwave_fault_prediction (user_input_data):
12
+ #convert to array
13
+ Input_array = numpy.asarray(user_input_data)
14
+ Input_array_reshaped = Input_array.reshape(1, -1)
15
+ make_prediction = loaded_model.predict(Input_array_reshaped)
16
+ print(make_prediction) # make_prediction= [10], pos is 0
17
+
18
+ if make_prediction== 0:
19
+ return 'site is up'
20
+ elif make_prediction == 1:
21
+ return'site is down: fault: 1. inteference 2. misalignment 3. one of the odu is faulty'
22
+ elif make_prediction == 2:
23
+ return 'site is down: fault: 1. NO power at remote site(A),2.ODU offline remote site(A)(check alarm \'IF cable open\') '
24
+ elif make_prediction == 3:
25
+ return 'site is down: fault:1.ODu hunged at remote site(A), reset power at both sites(A,B)'
26
+ elif make_prediction == 4:
27
+ return 'site is down: fault: 1. cascaded cable faulty at hub Site (B), 2. ODU/IDU/If cable offline,at remote end'
28
+ elif make_prediction == 5:
29
+ return'site is down: fault: 1 ODU at hub site(B)degraded( reset ODU, reterminate IF cable,check alarm)'
30
+ elif make_prediction == 6:
31
+ return 'site is down: faulty: if power is okay, odu burnt at either remote site (A) OR (B)'
32
+ else: # do feature elimination for data irrelevant to outcome
33
+ return 'case 7: site status cannot be determined by RSL data'
34
+
35
+ #construct interface for user data input
36
+ def main():
37
+ #give a title
38
+ streamlit.title('microwave fault detection web app')
39
+ #get input data from user
40
+ RSLA = streamlit.number_input('Site A Local end: enter RSL of the site, it must be negative number, input zero for no supervision',min_value=-99, max_value=0, value=-30, step=1,key= 'rsla')
41
+ #key= 'rslb' is to distinguish two similar widgets 'text_input' in streamlit
42
+ RSLB = streamlit.number_input('Site B Remote end: enter RSL of the Hub site, it must be negative number, input zero for no supervision',min_value=-99, max_value=0, value=-30, step=1,key= 'rslb')
43
+ #code for prediction
44
+ detection ="" #declare this variable to hold result like empty list
45
+ #mylist = []
46
+ if streamlit.button('click here for fault prediction'):
47
+ detection=microwave_fault_prediction([RSLA,RSLB])
48
+ #convert inputs into a single parameter using list [1,2]
49
+ #microwave_fault_prediction ...call the function to process input
50
+ streamlit.success(detection)
51
+ if __name__ == '__main__':
52
+ main()
53
+
54
+
55
+ # web app on your desktop local host
56
+ #run on your pycharm terminal ' streamlit run microwaveAPP.py '
57
+ # if using command window ensure the path is correct.. c:\users\idom...\pycharm..\machin learing>
58
+ # that is pionting to your python file
59
+
trained_lrmodel.sav ADDED
Binary file (913 Bytes). View file