""" Filter normal data for a particular ue-id to compare with a given sample
Compare with normal data to find and return degradaton type
"""
""" Filter normal data for a particular ue-id to compare with a given sample
Compare with normal data to find and return degradaton type
"""
sample.index = range(len(sample))
for i in range(len(sample)):
if sample.iloc[i]['Anomaly'] == 1:
sample.index = range(len(sample))
for i in range(len(sample)):
if sample.iloc[i]['Anomaly'] == 1:
- query = """select * from "{}" where {} = \'{}\' and time<now() and time>now()-20s""".format(db.meas, db.ue, sample.iloc[i][db.ue])
+ query = """select * from {} where "{}" = \'{}\' and time<now() and time>now()-20s""".format(db.meas, db.ue, sample.iloc[i][db.ue])
- deg = self.find(sample.loc[i, :], normal.max(), db)
+ deg = self.find(sample.loc[i, :], normal.max(), db, threshold)
if deg:
sample.loc[i, 'Degradation'] = deg
if 'Throughput' in deg and ('RSRP' in deg or 'RSRQ' in deg):
if deg:
sample.loc[i, 'Degradation'] = deg
if 'Throughput' in deg and ('RSRP' in deg or 'RSRQ' in deg):
sample.loc[i, 'Anomaly'] = 0
return sample[['Anomaly', 'Degradation']].values.tolist()
sample.loc[i, 'Anomaly'] = 0
return sample[['Anomaly', 'Degradation']].values.tolist()
- def find(self, row, l, db):
+ def find(self, row, l, db, threshold):