Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|