Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def export_X_Y_Vectors(cls,matches):
- home_win = []
- away_win = []
- draw = []
- wanted_exit_for_A = []
- wanted_exit_for_D = []
- wanted_exit_for_H = []
- print(matches)
- for match in matches:
- if match.match_result is 'H':
- home_win.append([match.B365H, match.B365D, match.B365A, 1])
- home_win.append([match.BWH, match.BWD, match.BWA, 1])
- home_win.append([match.IWH, match.IWD, match.IWA, 1])
- home_win.append([match.LBH, match.LBD, match.LBA, 1])
- wanted_exit_for_H.append([1, 0, 0])
- wanted_exit_for_H.append([1, 0, 0])
- wanted_exit_for_H.append([1, 0, 0])
- wanted_exit_for_H.append([1, 0, 0])
- elif match.match_result is 'D':
- home_win.append([match.B365H, match.B365D, match.B365A, 1])
- home_win.append([match.BWH, match.BWD, match.BWA, 1])
- home_win.append([match.IWH, match.IWD, match.IWA, 1])
- home_win.append([match.LBH, match.LBD, match.LBA, 1])
- wanted_exit_for_D.append([0, 1, 0])
- wanted_exit_for_D.append([0, 1, 0])
- wanted_exit_for_D.append([0, 1, 0])
- wanted_exit_for_D.append([0, 1, 0])
- else:
- home_win.append([match.B365H, match.B365D, match.B365A, 1])
- home_win.append([match.BWH, match.BWD, match.BWA, 1])
- home_win.append([match.IWH, match.IWD, match.IWA, 1])
- home_win.append([match.LBH, match.LBD, match.LBA, 1])
- wanted_exit_for_A.append([0, 0, 1])
- wanted_exit_for_A.append([0, 0, 1])
- wanted_exit_for_A.append([0, 0, 1])
- wanted_exit_for_A.append([0, 0, 1])
- 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