coycs commited on
Commit
bdbaaec
1 Parent(s): b0aee22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -290,7 +290,13 @@ def train_model(x, y, test_size, algorithm, paras): # 模型训练
290
  # y_pred = [x[0] for x in y_pred.tolist()]
291
  y_test = np.array(y_test).tolist()
292
  y_pred = y_pred.tolist()
293
- return {"y_test": y_test, "y_pred": y_pred, "error": {"MAE": mae, "RMSE": rmse, "R2": r2}, "results": results}
 
 
 
 
 
 
294
  else:
295
  return "模型训练出错"
296
 
 
290
  # y_pred = [x[0] for x in y_pred.tolist()]
291
  y_test = np.array(y_test).tolist()
292
  y_pred = y_pred.tolist()
293
+
294
+ res = {"y_test": y_test, "y_pred": y_pred, "error": {
295
+ "MAE": mae, "RMSE": rmse, "R2": r2}, "results": results}
296
+ print(res)
297
+
298
+ return res
299
+ # return {"y_test": y_test, "y_pred": y_pred, "error": {"MAE": mae, "RMSE": rmse, "R2": r2}, "results": results}
300
  else:
301
  return "模型训练出错"
302