Browse Source

保存预测数据

yufeng0528 4 years ago
parent
commit
4311efff59
1 changed files with 5 additions and 1 deletions
  1. 5 1
      linear/train.py

+ 5 - 1
linear/train.py

@@ -59,15 +59,19 @@ def demo():
59 59
 	print("测试集MSE:",test_mse)
60 60
 
61 61
 	# train_curve = curce_data(X_train,y_train,y_pred_train)
62
-	# test_curve = curce_data(X_test,y_test,y_pred_test)
62
+	test_curve = curce_data(X_test,y_test,y_pred_test)
63 63
 	print("推广mse差", test_mse-train_mse)
64 64
 
65 65
 	'''
66 66
 	with open("train_curve.csv","w") as f :
67 67
 		f.writelines("\n".join(train_curve))
68
+	保存数据
68 69
 	with open("test_curve.csv","w") as f :
69 70
 		f.writelines("\n".join(test_curve))
70 71
 	'''
72
+	for x in test_curve:
73
+		print(x)
74
+
71 75
 	return X_train,y_train, model.coef_, model.intercept_
72 76
 
73 77