kyleskom / NBA-Machine-Learning-Sports-Betting

NBA sports betting using machine learning
1.16k stars 431 forks source link

TypeError: '>=' not supported between instances of 'NoneType' and 'int #277

Closed xalppt closed 11 months ago

xalppt commented 1 year ago

python3 main.py -xgb -odds=fanduel

if american_odds >= 100: TypeError: '>=' not supported between instances of 'NoneType' and 'int'

Above is the problem I encounter when running main.py on vs code.

xalppt commented 1 year ago

@kyleskom could you please help me to fix this issue as I want to prepare for the coming season please and thank you.

Mihailoc commented 11 months ago

I have the same problem.

miztizm commented 11 months ago

i have the same trouble !

python main.py -xgb -odds=fanduel
2023-09-26 21:21:39.705662: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
------------------fanduel odds data------------------
Dallas Mavericks (None) @ Minnesota Timberwolves (None)
---------------XGBoost Model Predictions---------------
Minnesota Timberwolves (62.2%) vs Dallas Mavericks: OVER None (95.8%)
---------------------Expected Value--------------------
Traceback (most recent call last):
  File "C:\NBA-Machine-Learning-Sports-Betting-master\main.py", line 132, in <module>
    main()
  File "C:\NBA-Machine-Learning-Sports-Betting-master\main.py", line 112, in main
    XGBoost_Runner.xgb_runner(data, todays_games_uo, frame_ml, games, home_team_odds, away_team_odds, args.kc)
  File "C:\NBA-Machine-Learning-Sports-Betting-master\src\Predict\XGBoost_Runner.py", line 89, in xgb_runner
    bankroll_fraction_home = bankroll_descriptor + str(kc.calculate_kelly_criterion(home_team_odds[count], ml_predictions_array[count][0][1])) + '%'
  File "C:\NBA-Machine-Learning-Sports-Betting-master\src\Utils\Kelly_Criterion.py", line 15, in calculate_kelly_criterion
    decimal_odds = american_to_decimal(american_odds)
  File "C:\NBA-Machine-Learning-Sports-Betting-master\src\Utils\Kelly_Criterion.py", line 5, in american_to_decimal
    if american_odds >= 100:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
godlike007322 commented 11 months ago

i have the same trouble

kyleskom commented 11 months ago

There are no games. Its trying to get odds for games that don't exist yet, try again when the season starts.