Bladeren bron

detection

zhuxi 2 jaren geleden
bovenliggende
commit
cb98089a9d
1 gewijzigde bestanden met toevoegingen van 2 en 4 verwijderingen
  1. 2 4
      LIB/MIDDLE/Anomaly_Detection/V1_0_0/main_detection.py

+ 2 - 4
LIB/MIDDLE/Anomaly_Detection/V1_0_0/main_detection.py

@@ -64,15 +64,13 @@ for k in range(l):
             outliers1=detect_outliers(res1,pred1,threshold=30)
             outliers2=detect_outliers(res2,pred2,threshold=16)
             if (len(outliers1)>0) & (len(outliers2)>0):
-                outliers=check_anomaly(outliers1,outliers2)
+                outliers=check_anomaly(outliers1,outliers2,res2)
                 if len(outliers)>5:
-                    outliers.to_csv('outliers'+sn+'.csv',encoding='gbk')
                     outliers['sn']=sn
+                    outliers=outliers.reset_index()
                     anomalies=anomalies.append(outliers)
-                    anomalies.to_csv('anomalies.csv',encoding='gbk')
                     if df_diag_ram_sn.empty: 
                         product_id=sn
-                        outliers=outliers.reset_index()
                         start_time=outliers.loc[0,'时间']
                         start_time=start_time[:14]+start_time[16]+'0:00'
                         if outliers.loc[-1,'时间'] == pred1.loc[-1,'时间']: