Guest User

Untitled

a guest
May 25th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. model.compile(optimizer=adam, loss='binary_crossentropy', metrics=['accuracy'])
  2. #print("Traning Model...")
  3. model.fit(X_train, y_train, batch_size=batch_size, epochs=epochs, verbose=1, callbacks=[checkpoint], validation_data=(X_test, y_test)) # starts training
  4. print("Testing Model")
  5. output = model.predict(X_final, batch_size = batch_size)
  6. for pred_i in output:
  7. pred_i[pred_i >=0.5] = 1
  8. pred_i[pred_i < 0.5] = 0
  9. print "F1: " + str(f1_score(y_final, output, average='micro'))
  10. print "Accuracy: " + str(accuracy_score(y_final, output))
  11.  
  12. mscores = model.evaluate(X_final, y_final, batch_size = batch_size)
  13. print mscores
  14.  
  15. Creating Model...
  16. Testing Model
  17. F1: 0.7157894736842105
  18. Accuracy: 0.3530864197530864
  19. 405/405 [==============================] - 8s 20ms/step
  20. ['0.15227678694106914', '0.9422222640779283']
Add Comment
Please, Sign In to add comment