forked from vnguyen5/MLB-Machine-Learning-Sports-Betting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (23 loc) · 694 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import copy
import numpy as np
import pandas as pd
import xgboost as xgb
from colorama import Fore, Style, init, deinit
model = xgb.Booster()
model.load_model('./Models_Test/XGBoost_61.3%_ML-2.json')
test = {
'games_away': 100,
'runs_away': .3,
'ops_away': .6,
'games_home': 100,
'runs_home': 3.3,
'ops_home': .9,
}
print(type(test))
ml_prediction = model.predict(xgb.DMatrix(np.array([[6,3.3,.6,6,3.3,.6]])))
winner = int(np.argmax(ml_prediction))
print(winner)
winner_confidence = ml_prediction
print(winner_confidence)
winner_confidence = round(winner_confidence[0][1] * 100, 1)
print(winner_confidence)