CentOS 7 上安裝 NBA
全部以root執行
環境安裝
yum -y update
yum -y install epel-release
yum -y install wget make cmake gcc bzip2-devel libffi-devel zlib-devel sqlite-devel git
yum -y groupinstall "Development Tools"
關閉 SELinux
getenforce
setenforce 0
vi /etc/sysconfig/selinux
將 SELINUX=enforcing改為 SELINUX=disabled
開 防火牆 及 port 5000
systemctl start firewalld
systemctl status firewalld
firewall-cmd --zone=public --add-port=5000/tcp --permanent
firewall-cmd --reload
安裝 openssl 1.1.1
yum -y remove openssl openssl-devel
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
tar xvf openssl-1.1.1w.tar.gz
cd openssl-1.1*/
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
make -j $(nproc)
make install
ldconfig
tee /etc/profile.d/openssl.sh<<EOF
export PATH=/usr/local/openssl/bin:\$PATH
export LD_LIBRARY_PATH=/usr/local/openssl/lib:\$LD_LIBRARY_PATH
EOF
source /etc/profile.d/openssl.sh
logout
再登入
which openssl
安裝 Python 3.11
cd
wget https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz
tar xvf Python-3.11.4.tgz
cd Python-3.11*/
LDFLAGS="${LDFLAGS} -Wl,-rpath=/usr/local/openssl/lib" ./configure --with-openssl=/usr/local/openssl --enable-loadable-sqlite-extensions && make && make altinstall
python3.11
import ssl
ssl.OPENSSL_VERSION
pip3.11 --version
pip3.11 install --upgrade pip
安裝 NBA
cd
git clone https://github.com/kyleskom/NBA-Machine-Learning-Sports-Betting.git
cd NBA-Machine-Learning-Sports-Betting
pip3.11 install -r requirements.txt
python3.11 main.py -xgb -odds=fanduel
包含 fanduel, draftkings, betmgm, pointsbet, caesars, wynn, bet_rivers_ny
取完整資料
cd src/Process-Data
python3.11 -m Get_Data
python3.11 -m Get_Odds_Data
python3.11 -m Create_Games
訓練模型
cd ../Train-Models
python3.11 -m XGBoost_Model_ML
python3.11 -m XGBoost_Model_UO
開啟 web 連線
cd NBA-Machine-Learning-Sports-Betting/Flask
vi app.py
將 python 改為 python3.11
flask --debug run --host=0.0.0.0