kyleskom / NBA-Machine-Learning-Sports-Betting

NBA sports betting using machine learning
1.21k stars 441 forks source link

New problem #18

Closed obtim closed 3 years ago

obtim commented 3 years ago

Started scrip

root@osboxes:/home/osboxes/NBA-Machine-Learning-Sports-Betting# python3 main.py -xgb 2021-11-01 21:56:48.731620: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2021-11-01 21:56:48.731730: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. WARNING:tensorflow:SavedModel saved prior to TF 2.5 detected when loading Keras model. Please ensure that you are saving the model with model.save() or tf.keras.models.save_model(), NOT tf.saved_model.save(). To confirm, there should be a file named "keras_metadata.pb" in the SavedModel directory. 2021-11-01 21:56:49.811503: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory 2021-11-01 21:56:49.811537: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303) 2021-11-01 21:56:49.811582: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (osboxes): /proc/driver/nvidia/version does not exist 2021-11-01 21:56:49.811768: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. WARNING:tensorflow:SavedModel saved prior to TF 2.5 detected when loading Keras model. Please ensure that you are saving the model with model.save() or tf.keras.models.save_model(), NOT tf.saved_model.save(). To confirm, there should be a file named "keras_metadata.pb" in the SavedModel directory.

Paste data

Charlotte Hornets vs Cleveland Cavaliers: 216 Charlotte Hornets odds: 1.512
Cleveland Cavaliers odds: 2.82 Indiana Pacers vs San Antonio Spurs: 219.5 Indiana Pacers odds: 1.782 San Antonio Spurs odds: 2.522 Philadelphia 76ers vs Portland Trail Blazers: 220.5 Philadelphia 76ers odds: 1.815 Portland Trail Blazers odds: 2.155 Atlanta Hawks vs Washington Wizards: 221.5 Atlanta Hawks odds: 1.558 Washington Wizards odds: 3.165 Boston Celtics vs Chicago Bulls: 218.5 Boston Celtics odds: 1.842 Chicago Bulls odds: 2.41 New York Knicks vs Toronto Raptors: 208.5 New York Knicks odds: 1.44 Toronto Raptors odds: 3.7 Memphis Grizzlies vs Denver Nuggets: 213.5 Memphis Grizzlies odds: 2.04 Denver Nuggets odds: 1.93 Minnesota Timberwolves vs Orlando Magic: 216.5 Minnesota Timberwolves odds: 1.31 Orlando Magic odds: 4.76 LA Clippers vs Oklahoma City Thunder: 213 LA Clippers odds: 1.16 Oklahoma City Thunder odds: 8

Got prediction

---------------XGBoost Model Predictions--------------- Charlotte Hornets (84.1%) vs Cleveland Cavaliers: OVER 216 (59.8%) Indiana Pacers vs San Antonio Spurs (55.2%): OVER 219.5 (68.9%) Philadelphia 76ers (76.7%) vs Portland Trail Blazers: OVER 220.5 (66.4%) Atlanta Hawks vs Washington Wizards (77.3%): UNDER 221.5 (68.3%) Boston Celtics vs Chicago Bulls (81.9%): UNDER 218.5 (59.0%) New York Knicks (92.0%) vs Toronto Raptors: UNDER 208.5 (72.4%) Memphis Grizzlies vs Denver Nuggets (63.9%): OVER 213.5 (58.4%) Minnesota Timberwolves (92.1%) vs Orlando Magic: UNDER 216.5 (73.5%) LA Clippers (64.0%) vs Oklahoma City Thunder: UNDER 213 (75.6%)

Got error here

--------------------Expected Value--------------------- Traceback (most recent call last): File "/home/osboxes/NBA-Machine-Learning-Sports-Betting/main.py", line 79, in main() File "/home/osboxes/NBA-Machine-Learning-Sports-Betting/main.py", line 61, in main XGBoost_Runner.xgb_runner(data, todays_games_uo, frame_ml, games, home_team_odds, away_team_odds) File "/home/osboxes/NBA-Machine-Learning-Sports-Betting/src/Predict/XGBoost_Runner.py", line 79, in xgb_runner ev_home = float(Expected_Value.expected_value(ml_predictions_array[count][0][1], int(home_team_odds[count]))) ValueError: invalid literal for int() with base 10: '1.512'

kyleskom commented 3 years ago

Please use American odds. Example: Oklahoma City Thunder: 605 Los Angeles Clippers: -805