Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. def export_X_Y_Vectors(cls,matches):
  2. home_win = []
  3. away_win = []
  4. draw = []
  5. wanted_exit_for_A = []
  6. wanted_exit_for_D = []
  7. wanted_exit_for_H = []
  8. print(matches)
  9. for match in matches:
  10. if match.match_result is 'H':
  11. home_win.append([match.B365H, match.B365D, match.B365A, 1])
  12. home_win.append([match.BWH, match.BWD, match.BWA, 1])
  13. home_win.append([match.IWH, match.IWD, match.IWA, 1])
  14. home_win.append([match.LBH, match.LBD, match.LBA, 1])
  15. wanted_exit_for_H.append([1, 0, 0])
  16. wanted_exit_for_H.append([1, 0, 0])
  17. wanted_exit_for_H.append([1, 0, 0])
  18. wanted_exit_for_H.append([1, 0, 0])
  19.  
  20. elif match.match_result is 'D':
  21. home_win.append([match.B365H, match.B365D, match.B365A, 1])
  22. home_win.append([match.BWH, match.BWD, match.BWA, 1])
  23. home_win.append([match.IWH, match.IWD, match.IWA, 1])
  24. home_win.append([match.LBH, match.LBD, match.LBA, 1])
  25. wanted_exit_for_D.append([0, 1, 0])
  26. wanted_exit_for_D.append([0, 1, 0])
  27. wanted_exit_for_D.append([0, 1, 0])
  28. wanted_exit_for_D.append([0, 1, 0])
  29.  
  30. else:
  31. home_win.append([match.B365H, match.B365D, match.B365A, 1])
  32. home_win.append([match.BWH, match.BWD, match.BWA, 1])
  33. home_win.append([match.IWH, match.IWD, match.IWA, 1])
  34. home_win.append([match.LBH, match.LBD, match.LBA, 1])
  35. wanted_exit_for_A.append([0, 0, 1])
  36. wanted_exit_for_A.append([0, 0, 1])
  37. wanted_exit_for_A.append([0, 0, 1])
  38. wanted_exit_for_A.append([0, 0, 1])
  39.  
  40. return home_win + draw + away_win, wanted_exit_for_H + wanted_exit_for_D + wanted_exit_for_A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement