Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x, _, _, _, y, _ = get_data()
- mean_accuracy = 0.0
- kf = ms.KFold(n_splits=5, shuffle=True)
- count = 1
- for train_index, test_index in kf.split(x):
- train_x, test_x = x[train_index], x[test_index]
- train_y, test_y = y[train_index], y[test_index]
- with tf.Session() as sess:
- mlp.train(sess, train_x, train_y, n_epochs=1000, batch_size=32)
- accuracy = mlp.get_accuracy(sess, test_x, test_y)
- mean_accuracy += accuracy
- print("Accuracy on this fold: ", accuracy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement