2 次代码提交 bf6d2ef5db ... f512609536

作者 SHA1 备注 提交日期
  zhuxi f512609536 Merge branch 'dev' of http://git.fast-fun.cn:92/lmstack/data_analyze_platform into dev 2 年之前
  zhuxi cc4d8edb99 core 2 年之前
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      LIB/MIDDLE/FaultDetection/V1_0_2/aelstm.py

+ 4 - 2
LIB/MIDDLE/FaultDetection/V1_0_2/aelstm.py

@@ -112,8 +112,8 @@ def ref(test_loss,new_test):
     test_loss_sum=test_loss.sum(axis=1)
     test_loss_max=test_loss.max(axis=1)
     ref_test=new_test[['n_split','window_step']].reset_index(drop=True)
-    ref_test['test_loss_sum']=test_loss_sum
-    ref_test['test_loss_max']=test_loss_max
+    ref_test['test_loss_sum']=list(map(lambda x: round(x,3),test_loss_sum))
+    ref_test['test_loss_max']=list(map(lambda x: round(x,3),test_loss_max))
     return ref_test
 
 def prediction(df_stand,scaler,scaler2,model,model2):
@@ -237,6 +237,8 @@ def threshold(res,group,end_time):
     df_res=df_res.rename(columns = {"product_id_x": "product_id"})
     df_res=df_res.rename(columns = {"SOC[%]": "SOC"})
     df_res2=df_res[['product_id','start_time','end_time','diff_min','SOC','AnoScoreV_sum_max','AnoScoreV_max_max','AnoScoreT_sum_max','AnoScoreT_max_max']]
+    df_res2['start_time']=list(map(lambda x:str(x),list(df_res2['start_time'])))
+    df_res2['end_time']=list(map(lambda x:str(x),list(df_res2['end_time'])))
     return df_res2,diff
 
 def arrange(result,result_final,start_time,diff):