SHARE
TWEET

Untitled

a guest May 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # use the test set to evaluate the policy
  2. states = Tt[:, :, 0].flatten().tolist()
  3.  
  4. values = []
  5. best_actions = []
  6. for s in states:
  7.     a_best, v_best = best_action(Q, s, offers)
  8.     values.append(v_best)
  9.     best_actions.append(a_best)
  10.  
  11. s_tsne = TSNE().fit_transform(states)
  12.  
  13. # value function for each state
  14. plt.scatter(s_tsne[:, 0], s_tsne[:, 1], c = values)
  15. plt.colorbar()
  16. plt.show()
  17.  
  18. # recommended next best actions for each state
  19. plt.scatter(s_tsne[:, 0], s_tsne[:, 1], c = best_actions)
  20. plt.colorbar()
  21. plt.show()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top