【发布时间】:2019-09-28 05:45:34
【问题描述】:
我是张量流的初学者,需要 获取预测值(如果客户将订阅定期存款)作为输出(以数据框格式),用于给定数据框作为输入的多感知 ANN 模型。 对于银行活动.. 我们指的是这个样本 https://github.com/ManikandanJeyabal/Workplace/blob/master/ANN/TensorFlow/BankMarketing.py
我们尝试在带有 Python 3.6 的 Azure 虚拟机上的笔记本中运行它
在上面的示例中,我们需要修改下面的源代码来获得预测(以数据框的形式,以便它可以显示为报告。)
plt.plot(mse_his, 'r')
plt.show()
plt.plot(accu_his)
plt.show()
# print the final accuracy
correct_pred = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1))
accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
print("Test Accuracy--> ", (sess.run(accuracy, feed_dict={x: x_test, y_: y_test})))
# print final mean square error
pred_y = sess.run(y, feed_dict={x: x_test})
mse = tf.reduce_mean(tf.square(pred_y - y_test))
print("MSE: %.4f" % sess.run(mse))
print(correct_pred)
print(y_test) ```
we need to get the output in the form of panadas dataframe along with the predicted columns?
Please guide me here
----------------------------------------------
Updates:
Thank you for the response,McAngus..
After the changes in comments below.. I could render the dataframe output but with this output , How can I derive True or False Predicted Value?
[Dataframe Output][1]
[1]: https://i.stack.imgur.com/f8iJ9.png
【问题讨论】:
标签: tensorflow machine-learning neural-network