Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. x, _, _, _, y, _ = get_data()
  2.  
  3. mean_accuracy = 0.0
  4. kf = ms.KFold(n_splits=5, shuffle=True)
  5.  
  6. count = 1
  7. for train_index, test_index in kf.split(x):
  8.  
  9. train_x, test_x = x[train_index], x[test_index]
  10. train_y, test_y = y[train_index], y[test_index]
  11.  
  12. with tf.Session() as sess:
  13. mlp.train(sess, train_x, train_y, n_epochs=1000, batch_size=32)
  14.  
  15. accuracy = mlp.get_accuracy(sess, test_x, test_y)
  16. mean_accuracy += accuracy
  17. print("Accuracy on this fold: ", accuracy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement