如何将预测结果循环写入一个csv文件中,将每一个Y[j]写入到同一个csv文件中
Y= []
tmp_x1 = X_train.copy()
tmp_x2 = X_test.copy()
for j in range(100):
for i in range(6585):
tmp_x1['X1'][i] = X1[j]
tmp_Y1 = list(M.predict(tmp_x1))
for i in range(1966):
tmp_x2['X1'][i] = X1[j]
tmp_Y2 = list(M.predict(tmp_x2))
Y.append(tmp_Y1 + tmp_Y2)