diff --git "a/Notebook.ipynb" "b/Notebook.ipynb" new file mode 100644--- /dev/null +++ "b/Notebook.ipynb" @@ -0,0 +1,1532 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import pickle as pkl\n", + "\n", + "predictions_this_year = {}\n", + "\n", + "with open('Source/Data/predictions_this_year.pkl', 'wb') as f:\n", + " pkl.dump(predictions_this_year, f)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "key = '{\"type\": \"service_account\",\"project_id\": \"bmllc-398613\",\"private_key_id\": \"dae9f17eb79aee559b936bd88406ea399f729d9e\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDhsB9x17UbxaT8\\nB/+2QziaZsdfeonp4ujU9v1yLLZfUS32mQGCanACklaMELrQ/KDaaJR9LW8xY7mH\\nKQ43I0K6wDq2OedR9HHVlP4JE1yvnJAoABMq46FVUlNF9dodyyf6Ajnnq28ahhTJ\\nLZcRk3KNgRVnBCxEHaUUPFZXXfxDI9Ptnvq7oHSuwNMHFbbla8Zo0x+tud1UWLOo\\nEbOHjdSYqEIcIdcT2DU3yVTig6C+X7aI10Nvlcq+NyXZCm/hx3JLyaEDCY3XTKAn\\nHao7zt5rOIp7Hf88hdeR3eQvSTgIwtzssPRkJmmGBpvBt/s/XcNvhWjwjTJ/Oq6q\\nr9FGTw5VAgMBAAECggEAAWDtCun8E5EFLVDzMUQp2q+ZX4OachD5G8vtHRRu122M\\nhVQb8UBV3NN+BIRZpSCAmbTygJfqykzHUQRhhNlfSqVqoRBWJxGs3FbOUnSJfWfM\\nbaIf0S7rc7T5Xepe4bhgTyOnrOWcMSJJNY1kvdkTuw+NzOpL8Zfow+iLx87YKqTQ\\nxpf33VUWdYwMi3ceakDcmJ32sxXs0xw2gPrmVBbz9pLBjLW68GNkMIYjk8OfN46d\\nSO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gserviceaccount.com\",\"client_id\": \"103296969416633370732\", \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/huggingface%40bmllc-398613.iam.gserviceaccount.com\", \"universe_domain\": \"googleapis.com\"}'.replace('\\n','\\\\n')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'{\"type\":\"service_account\",\"project_id\":\"bmllc-398613\",\"private_key_id\":\"dae9f17eb79aee559b936bd88406ea399f729d9e\",\"private_key\":\"-----BEGIN PRIVATE KEY-----\\\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDhsB9x17UbxaT8\\\\nB/+2QziaZsdfeonp4ujU9v1yLLZfUS32mQGCanACklaMELrQ/KDaaJR9LW8xY7mH\\\\nKQ43I0K6wDq2OedR9HHVlP4JE1yvnJAoABMq46FVUlNF9dodyyf6Ajnnq28ahhTJ\\\\nLZcRk3KNgRVnBCxEHaUUPFZXXfxDI9Ptnvq7oHSuwNMHFbbla8Zo0x+tud1UWLOo\\\\nEbOHjdSYqEIcIdcT2DU3yVTig6C+X7aI10Nvlcq+NyXZCm/hx3JLyaEDCY3XTKAn\\\\nHao7zt5rOIp7Hf88hdeR3eQvSTgIwtzssPRkJmmGBpvBt/s/XcNvhWjwjTJ/Oq6q\\\\nr9FGTw5VAgMBAAECggEAAWDtCun8E5EFLVDzMUQp2q+ZX4OachD5G8vtHRRu122M\\\\nhVQb8UBV3NN+BIRZpSCAmbTygJfqykzHUQRhhNlfSqVqoRBWJxGs3FbOUnSJfWfM\\\\nbaIf0S7rc7T5Xepe4bhgTyOnrOWcMSJJNY1kvdkTuw+NzOpL8Zfow+iLx87YKqTQ\\\\nxpf33VUWdYwMi3ceakDcmJ32sxXs0x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4tXLQR9w31YhZ5ONBNTQ9\\\\n-----END PRIVATE KEY-----\\\\n\",\"client_email\":\"huggingface@bmllc-398613.iam.gserviceaccount.com\",\"client_id\":\"103296969416633370732\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"token_uri\":\"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\":\"https://www.googleapis.com/robot/v1/metadata/x509/huggingface%40bmllc-398613.iam.gserviceaccount.com\",\"universe_domain\":\"googleapis.com\"}'" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import json\n", + "\n", + "your_json = {\n", + " \"type\": \"service_account\",\n", + " \"project_id\": \"bmllc-398613\",\n", + " \"private_key_id\": \"dae9f17eb79aee559b936bd88406ea399f729d9e\",\n", + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDhsB9x17UbxaT8\\nB/+2QziaZsdfeonp4ujU9v1yLLZfUS32mQGCanACklaMELrQ/KDaaJR9LW8xY7mH\\nKQ43I0K6wDq2OedR9HHVlP4JE1yvnJAoABMq46FVUlNF9dodyyf6Ajnnq28ahhTJ\\nLZcRk3KNgRVnBCxEHaUUPFZXXfxDI9Ptnvq7oHSuwNMHFbbla8Zo0x+tud1UWLOo\\nEbOHjdSYqEIcIdcT2DU3yVTig6C+X7aI10Nvlcq+NyXZCm/hx3JLyaEDCY3XTKAn\\nHao7zt5rOIp7Hf88hdeR3eQvSTgIwtzssPRkJmmGBpvBt/s/XcNvhWjwjTJ/Oq6q\\nr9FGTw5VAgMBAAECggEAAWDtCun8E5EFLVDzMUQp2q+ZX4OachD5G8vtHRRu122M\\nhVQb8UBV3NN+BIRZpSCAmbTygJfqykzHUQRhhNlfSqVqoRBWJxGs3FbOUnSJfWfM\\nbaIf0S7rc7T5Xepe4bhgTyOnrOWcMSJJNY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e1SNn0AP+k+veEvRicDRVWSk0\\n7dS4tXLQR9w31YhZ5ONBNTQ9\\n-----END PRIVATE KEY-----\\n\",\n", + " \"client_email\": \"huggingface@bmllc-398613.iam.gserviceaccount.com\",\n", + " \"client_id\": \"103296969416633370732\",\n", + " \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n", + " \"token_uri\": \"https://oauth2.googleapis.com/token\",\n", + " \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n", + " \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/huggingface%40bmllc-398613.iam.gserviceaccount.com\",\n", + " \"universe_domain\": \"googleapis.com\"\n", + "}\n", + "\n", + "one_line_json = json.dumps(your_json, separators=(',', ':')).replace(\"\\n\", \"\\\\n\")\n", + "one_line_json" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'2023_1_CIN_CLE': {'Moneyline': {'Winner': 'NA',\n", + " 'Probabilities': ['N/A'],\n", + " 'rowIndex': 1},\n", + " 'Over/Under': {'Over/Under': 'N/A', 'Probability': ['N/A'], 'rowIndex': 1}}}" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import json\n", + "from google.cloud import storage\n", + "\n", + "# authenticate gcp\n", + "gcp_sa_key = json.loads(key)\n", + "client = storage.Client.from_service_account_info(gcp_sa_key)\n", + "bucket = client.get_bucket('bmllc-marci-data-bucket')\n", + "\n", + "# download\n", + "blob = bucket.blob('predictions_this_year.pkl')\n", + "buffer = blob.download_as_bytes()\n", + "predictions_this_year = pickle.loads(buffer)\n", + "\n", + "predictions_this_year" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
MoneylineOver/Under
2023_1_CIN_CLE{'Winner': 'NA', 'Probabilities': ['N/A'], 'ro...{'Over/Under': 'N/A', 'Probability': ['N/A'], ...
\n", + "
" + ], + "text/plain": [ + " Moneyline \\\n", + "2023_1_CIN_CLE {'Winner': 'NA', 'Probabilities': ['N/A'], 'ro... \n", + "\n", + " Over/Under \n", + "2023_1_CIN_CLE {'Over/Under': 'N/A', 'Probability': ['N/A'], ... " + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "pd.DataFrame(predictions_this_year).T" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [], + "source": [ + "predictions_this_year = {}\n", + "buffer = pkl.dumps(predictions_this_year)\n", + "blob.upload_from_string(buffer, content_type='application/octet-stream')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "service_account_id = 'service-950327177777@gs-project-accounts.iam.gserviceaccount.com'" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.6666666666666666" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gpt_picks = ['Kansas City Chiefs',\n", + " 'Atlanta Falcons',\n", + " 'Baltimore Ravens',\n", + " 'Cleveland Browns',\n", + " 'Indianapolis Colts',\n", + " 'Tampa Bay Buccaneers',\n", + " 'New Orleans Saints',\n", + " 'San Francisco 49ers',\n", + " 'Washington Commanders',\n", + " 'Green Bay Packers',\n", + " 'Las Vegas Raiders',\n", + " 'Los Angeles Chargers',\n", + " 'New England Patriots',\n", + " 'Seattle Seahawks',\n", + " 'Dallas Cowboys']\n", + "\n", + "correct = [0,\n", + " 1,\n", + " 1,\n", + " 1,\n", + " 0,\n", + " 1,\n", + " 1,\n", + " 1,\n", + " 1,\n", + " 1,\n", + " 1,\n", + " 0,\n", + " 0,\n", + " 0,\n", + " 1]\n", + "\n", + "sum(correct)/len(correct)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
game_idGPWLW_PCTTOPFGAFGMFG_PCTPassTD...Sacks_Allowed.AwayPenalties.AwayFirstDowns.Away3rdDownConverted.Away3rdDownFailed.Away3rdDownAllowed.Away3rdDownDefended.AwayPTS.AwayPointDiff.Awaygame_date
02023_01_SF_PIT1.00.01.00.011183.00.00.0NaN1.0...3.011.021.06.07.05.010.030.023.02023-09-10
12023_01_MIA_LAC1.00.01.00.024718.02.02.01.0000001.0...0.06.029.04.05.09.06.036.02.02023-09-10
22023_01_CIN_CLE1.01.00.01.015262.03.03.01.0000001.0...2.04.06.02.013.04.010.03.0-21.02023-09-10
32023_01_GB_CHI1.00.01.00.017119.02.02.01.0000001.0...1.09.015.09.07.03.010.038.018.02023-09-10
42023_01_PHI_NE1.00.01.00.017085.00.00.0NaN3.0...3.05.017.04.09.05.010.025.05.02023-09-10
52023_01_DAL_NYG1.00.01.00.023666.02.00.00.0000000.0...0.05.018.06.07.05.011.040.040.02023-09-10
62023_01_DET_KC1.00.01.00.015329.02.02.01.0000002.0...1.04.019.05.010.05.09.021.01.02023-09-07
72023_01_ARI_WAS1.01.00.01.014896.02.02.01.0000001.0...3.09.013.04.010.04.08.016.0-4.02023-09-10
82023_01_TB_MIN1.00.01.00.019010.01.01.01.0000002.0...1.03.016.06.011.06.08.020.03.02023-09-10
92023_01_HOU_BAL1.01.00.01.015653.01.01.01.0000000.0...5.09.017.07.011.08.07.09.0-16.02023-09-10
102023_01_LA_SEA1.00.01.00.013979.03.02.00.6666671.0...0.07.027.011.06.02.07.030.017.02023-09-10
112023_01_TEN_NO1.01.00.01.014954.03.03.01.0000001.0...3.06.016.02.010.07.09.015.0-1.02023-09-10
122023_01_JAX_IND1.00.01.00.013879.00.00.0NaN1.0...2.04.020.03.09.02.010.031.010.02023-09-10
132023_01_CAR_ATL1.01.00.01.010398.01.01.01.0000001.0...2.09.020.05.09.02.08.010.0-14.02023-09-10
142023_01_LV_DEN1.00.01.00.029267.02.01.00.5000002.0...0.010.020.05.06.05.06.017.01.02023-09-10
\n", + "

15 rows × 65 columns

\n", + "
" + ], + "text/plain": [ + " game_id GP W L W_PCT TOP FGA FGM FG_PCT \\\n", + "0 2023_01_SF_PIT 1.0 0.0 1.0 0.0 11183.0 0.0 0.0 NaN \n", + "1 2023_01_MIA_LAC 1.0 0.0 1.0 0.0 24718.0 2.0 2.0 1.000000 \n", + "2 2023_01_CIN_CLE 1.0 1.0 0.0 1.0 15262.0 3.0 3.0 1.000000 \n", + "3 2023_01_GB_CHI 1.0 0.0 1.0 0.0 17119.0 2.0 2.0 1.000000 \n", + "4 2023_01_PHI_NE 1.0 0.0 1.0 0.0 17085.0 0.0 0.0 NaN \n", + "5 2023_01_DAL_NYG 1.0 0.0 1.0 0.0 23666.0 2.0 0.0 0.000000 \n", + "6 2023_01_DET_KC 1.0 0.0 1.0 0.0 15329.0 2.0 2.0 1.000000 \n", + "7 2023_01_ARI_WAS 1.0 1.0 0.0 1.0 14896.0 2.0 2.0 1.000000 \n", + "8 2023_01_TB_MIN 1.0 0.0 1.0 0.0 19010.0 1.0 1.0 1.000000 \n", + "9 2023_01_HOU_BAL 1.0 1.0 0.0 1.0 15653.0 1.0 1.0 1.000000 \n", + "10 2023_01_LA_SEA 1.0 0.0 1.0 0.0 13979.0 3.0 2.0 0.666667 \n", + "11 2023_01_TEN_NO 1.0 1.0 0.0 1.0 14954.0 3.0 3.0 1.000000 \n", + "12 2023_01_JAX_IND 1.0 0.0 1.0 0.0 13879.0 0.0 0.0 NaN \n", + "13 2023_01_CAR_ATL 1.0 1.0 0.0 1.0 10398.0 1.0 1.0 1.000000 \n", + "14 2023_01_LV_DEN 1.0 0.0 1.0 0.0 29267.0 2.0 1.0 0.500000 \n", + "\n", + " PassTD ... Sacks_Allowed.Away Penalties.Away FirstDowns.Away \\\n", + "0 1.0 ... 3.0 11.0 21.0 \n", + "1 1.0 ... 0.0 6.0 29.0 \n", + "2 1.0 ... 2.0 4.0 6.0 \n", + "3 1.0 ... 1.0 9.0 15.0 \n", + "4 3.0 ... 3.0 5.0 17.0 \n", + "5 0.0 ... 0.0 5.0 18.0 \n", + "6 2.0 ... 1.0 4.0 19.0 \n", + "7 1.0 ... 3.0 9.0 13.0 \n", + "8 2.0 ... 1.0 3.0 16.0 \n", + "9 0.0 ... 5.0 9.0 17.0 \n", + "10 1.0 ... 0.0 7.0 27.0 \n", + "11 1.0 ... 3.0 6.0 16.0 \n", + "12 1.0 ... 2.0 4.0 20.0 \n", + "13 1.0 ... 2.0 9.0 20.0 \n", + "14 2.0 ... 0.0 10.0 20.0 \n", + "\n", + " 3rdDownConverted.Away 3rdDownFailed.Away 3rdDownAllowed.Away \\\n", + "0 6.0 7.0 5.0 \n", + "1 4.0 5.0 9.0 \n", + "2 2.0 13.0 4.0 \n", + "3 9.0 7.0 3.0 \n", + "4 4.0 9.0 5.0 \n", + "5 6.0 7.0 5.0 \n", + "6 5.0 10.0 5.0 \n", + "7 4.0 10.0 4.0 \n", + "8 6.0 11.0 6.0 \n", + "9 7.0 11.0 8.0 \n", + "10 11.0 6.0 2.0 \n", + "11 2.0 10.0 7.0 \n", + "12 3.0 9.0 2.0 \n", + "13 5.0 9.0 2.0 \n", + "14 5.0 6.0 5.0 \n", + "\n", + " 3rdDownDefended.Away PTS.Away PointDiff.Away game_date \n", + "0 10.0 30.0 23.0 2023-09-10 \n", + "1 6.0 36.0 2.0 2023-09-10 \n", + "2 10.0 3.0 -21.0 2023-09-10 \n", + "3 10.0 38.0 18.0 2023-09-10 \n", + "4 10.0 25.0 5.0 2023-09-10 \n", + "5 11.0 40.0 40.0 2023-09-10 \n", + "6 9.0 21.0 1.0 2023-09-07 \n", + "7 8.0 16.0 -4.0 2023-09-10 \n", + "8 8.0 20.0 3.0 2023-09-10 \n", + "9 7.0 9.0 -16.0 2023-09-10 \n", + "10 7.0 30.0 17.0 2023-09-10 \n", + "11 9.0 15.0 -1.0 2023-09-10 \n", + "12 10.0 31.0 10.0 2023-09-10 \n", + "13 8.0 10.0 -14.0 2023-09-10 \n", + "14 6.0 17.0 1.0 2023-09-10 \n", + "\n", + "[15 rows x 65 columns]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "scores = pd.read_csv('Source/Data/gbg_this_year.csv')\n", + "scores" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "\n", + "headers = {\n", + "'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',\n", + "'Accept-Encoding': 'gzip, deflate',\n", + "'Accept-Language': 'en-US,en;q=0.9',\n", + "'Cache-Control': 'max-age=0',\n", + "'Connection': 'keep-alive',\n", + "'Dnt': '1',\n", + "'Upgrade-Insecure-Requests': '1',\n", + "'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'\n", + "}\n", + "\n", + "url = 'https://www.bettingpros.com/nfl/matchups/'\n", + "resp = requests.get(url, headers=headers)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "BettingPros\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from bs4 import BeautifulSoup\n", + "soup = BeautifulSoup(resp.text, 'html.parser')\n", + "soup" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'nfl_data_py'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\Brayden\\OneDrive - stern.nyu.edu\\Brayden Moore LLC\\Python\\Projects\\MARCI 3.0\\MARCI-NFL-Betting\\Notebook.ipynb Cell 12\u001b[0m line \u001b[0;36m1\n\u001b[1;32m----> 1\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mSource\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mBuild\u001b[39;00m \u001b[39mimport\u001b[39;00m build\n\u001b[0;32m 3\u001b[0m pbp \u001b[39m=\u001b[39m build\u001b[39m.\u001b[39mget_pbp_data([\u001b[39m2023\u001b[39m])\n\u001b[0;32m 4\u001b[0m pbp \u001b[39m=\u001b[39m pbp\u001b[39m.\u001b[39mdrop_duplicates(subset\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mgame_id\u001b[39m\u001b[39m'\u001b[39m)\n", + "File \u001b[1;32mc:\\Users\\Brayden\\OneDrive - stern.nyu.edu\\Brayden Moore LLC\\Python\\Projects\\MARCI 3.0\\MARCI-NFL-Betting\\Source\\Build\\build.py:1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mnfl_data_py\u001b[39;00m \u001b[39mimport\u001b[39;00m nfl_data_py \u001b[39mas\u001b[39;00m nfl\n\u001b[0;32m 2\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mtqdm\u001b[39;00m \u001b[39mimport\u001b[39;00m tqdm\n\u001b[0;32m 3\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mnumpy\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mnp\u001b[39;00m\n", + "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'nfl_data_py'" + ] + } + ], + "source": [ + "from Source.Build import build\n", + "\n", + "pbp = build.get_pbp_data([2023])\n", + "pbp = pbp.drop_duplicates(subset='game_id')" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
game_idtotalwinner
02023_01_ARI_WAS36Washington Commanders
1752023_01_CAR_ATL34Atlanta Falcons
3442023_01_CIN_CLE27Cleveland Browns
5172023_01_DAL_NYG40Dallas Cowboys
6832023_01_DET_KC41Detroit Lions
8622023_01_GB_CHI58Green Bay Packers
10422023_01_HOU_BAL34Baltimore Ravens
12272023_01_JAX_IND52Jacksonville Jaguars
14092023_01_LA_SEA43Los Angeles Rams
15862023_01_LV_DEN33Las Vegas Raiders
17442023_01_MIA_LAC70Miami Dolphins
19352023_01_PHI_NE45Philadelphia Eagles
21262023_01_SF_PIT37San Francisco 49ers
23022023_01_TB_MIN37Tampa Bay Buccaneers
24772023_01_TEN_NO31New Orleans Saints
\n", + "
" + ], + "text/plain": [ + " game_id total winner\n", + "0 2023_01_ARI_WAS 36 Washington Commanders\n", + "175 2023_01_CAR_ATL 34 Atlanta Falcons\n", + "344 2023_01_CIN_CLE 27 Cleveland Browns\n", + "517 2023_01_DAL_NYG 40 Dallas Cowboys\n", + "683 2023_01_DET_KC 41 Detroit Lions\n", + "862 2023_01_GB_CHI 58 Green Bay Packers\n", + "1042 2023_01_HOU_BAL 34 Baltimore Ravens\n", + "1227 2023_01_JAX_IND 52 Jacksonville Jaguars\n", + "1409 2023_01_LA_SEA 43 Los Angeles Rams\n", + "1586 2023_01_LV_DEN 33 Las Vegas Raiders\n", + "1744 2023_01_MIA_LAC 70 Miami Dolphins\n", + "1935 2023_01_PHI_NE 45 Philadelphia Eagles\n", + "2126 2023_01_SF_PIT 37 San Francisco 49ers\n", + "2302 2023_01_TB_MIN 37 Tampa Bay Buccaneers\n", + "2477 2023_01_TEN_NO 31 New Orleans Saints" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import os\n", + "import pickle as pkl\n", + "\n", + "# get team abbreviations\n", + "file_path = 'Source/Pickles/team_name_to_abbreviation.pkl'\n", + "with open(file_path, 'rb') as f:\n", + " team_name_to_abbreviation = pkl.load(f)\n", + "\n", + "file_path = 'Source/Pickles/team_abbreviation_to_name.pkl'\n", + "with open(file_path, 'rb') as f:\n", + " team_abbreviation_to_name = pkl.load(f)\n", + "\n", + "pbp[['season','week','away','home']] = pbp['game_id'].str.split('_', expand=True)\n", + "games = pbp[['game_id','away_score','home_score','season','week','away','home']]\n", + "games[['away_score','home_score','season','week']] = games[['away_score','home_score','season','week']].astype(int)\n", + "\n", + "games['away_team'] = games['away'].map(team_abbreviation_to_name)\n", + "games['home_team'] = games['home'].map(team_abbreviation_to_name)\n", + "\n", + "games['total'] = games['away_score'] + games['home_score']\n", + "games['winner'] = [a if a_s>h_s else h if h_s>a_s else 'Tie' for a,h,a_s,h_s in games[['away_team','home_team','away_score','home_score']].values]\n", + "results = games[['game_id','total','winner']]" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'games' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\Brayden\\OneDrive - stern.nyu.edu\\Brayden Moore LLC\\Python\\Projects\\MARCI 3.0\\MARCI-NFL-Betting\\Notebook.ipynb Cell 14\u001b[0m line \u001b[0;36m1\n\u001b[1;32m----> 1\u001b[0m results \u001b[39m=\u001b[39m games[[\u001b[39m'\u001b[39m\u001b[39mgame_id\u001b[39m\u001b[39m'\u001b[39m,\u001b[39m'\u001b[39m\u001b[39mtotal\u001b[39m\u001b[39m'\u001b[39m,\u001b[39m'\u001b[39m\u001b[39mwinner\u001b[39m\u001b[39m'\u001b[39m]]\n", + "\u001b[1;31mNameError\u001b[0m: name 'games' is not defined" + ] + } + ], + "source": [ + "results = games[['game_id','total','winner']]" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\Brayden\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\dateutil\\parser\\_parser.py:1207: UnknownTimezoneWarning: tzname EST identified but not understood. Pass `tzinfos` argument in order to correctly return a timezone-aware datetime. In a future version, this will raise an exception.\n", + " warnings.warn(\"tzname {tzname} identified but not understood. \"\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
game_idAway TeamHome TeamDatewinnertotal
02023_01_DET_KCDetroit LionsKansas City ChiefsThursday 9/7 08:20Detroit Lions41
12023_01_CIN_CLECincinnati BengalsCleveland BrownsSunday 9/10 01:00Cleveland Browns27
22023_01_JAX_INDJacksonville JaguarsIndianapolis ColtsSunday 9/10 01:00Jacksonville Jaguars52
32023_01_TB_MINTampa Bay BuccaneersMinnesota VikingsSunday 9/10 01:00Tampa Bay Buccaneers37
42023_01_TEN_NOTennessee TitansNew Orleans SaintsSunday 9/10 01:00New Orleans Saints31
52023_01_CAR_ATLCarolina PanthersAtlanta FalconsSunday 9/10 01:00Atlanta Falcons34
62023_01_HOU_BALHouston TexansBaltimore RavensSunday 9/10 01:00Baltimore Ravens34
72023_01_SF_PITSan Francisco 49ersPittsburgh SteelersSunday 9/10 01:00San Francisco 49ers37
82023_01_ARI_WASArizona CardinalsWashington CommandersSunday 9/10 01:00Washington Commanders36
92023_01_GB_CHIGreen Bay PackersChicago BearsSunday 9/10 04:25Green Bay Packers58
102023_01_MIA_LACMiami DolphinsLos Angeles ChargersSunday 9/10 04:25Miami Dolphins70
112023_01_LV_DENLas Vegas RaidersDenver BroncosSunday 9/10 04:25Las Vegas Raiders33
122023_01_PHI_NEPhiladelphia EaglesNew England PatriotsSunday 9/10 04:25Philadelphia Eagles45
132023_01_DAL_NYGDallas CowboysNew York GiantsSunday 9/10 08:20Dallas Cowboys40
\n", + "
" + ], + "text/plain": [ + " game_id Away Team Home Team \\\n", + "0 2023_01_DET_KC Detroit Lions Kansas City Chiefs \n", + "1 2023_01_CIN_CLE Cincinnati Bengals Cleveland Browns \n", + "2 2023_01_JAX_IND Jacksonville Jaguars Indianapolis Colts \n", + "3 2023_01_TB_MIN Tampa Bay Buccaneers Minnesota Vikings \n", + "4 2023_01_TEN_NO Tennessee Titans New Orleans Saints \n", + "5 2023_01_CAR_ATL Carolina Panthers Atlanta Falcons \n", + "6 2023_01_HOU_BAL Houston Texans Baltimore Ravens \n", + "7 2023_01_SF_PIT San Francisco 49ers Pittsburgh Steelers \n", + "8 2023_01_ARI_WAS Arizona Cardinals Washington Commanders \n", + "9 2023_01_GB_CHI Green Bay Packers Chicago Bears \n", + "10 2023_01_MIA_LAC Miami Dolphins Los Angeles Chargers \n", + "11 2023_01_LV_DEN Las Vegas Raiders Denver Broncos \n", + "12 2023_01_PHI_NE Philadelphia Eagles New England Patriots \n", + "13 2023_01_DAL_NYG Dallas Cowboys New York Giants \n", + "\n", + " Date winner total \n", + "0 Thursday 9/7 08:20 Detroit Lions 41 \n", + "1 Sunday 9/10 01:00 Cleveland Browns 27 \n", + "2 Sunday 9/10 01:00 Jacksonville Jaguars 52 \n", + "3 Sunday 9/10 01:00 Tampa Bay Buccaneers 37 \n", + "4 Sunday 9/10 01:00 New Orleans Saints 31 \n", + "5 Sunday 9/10 01:00 Atlanta Falcons 34 \n", + "6 Sunday 9/10 01:00 Baltimore Ravens 34 \n", + "7 Sunday 9/10 01:00 San Francisco 49ers 37 \n", + "8 Sunday 9/10 01:00 Washington Commanders 36 \n", + "9 Sunday 9/10 04:25 Green Bay Packers 58 \n", + "10 Sunday 9/10 04:25 Miami Dolphins 70 \n", + "11 Sunday 9/10 04:25 Las Vegas Raiders 33 \n", + "12 Sunday 9/10 04:25 Philadelphia Eagles 45 \n", + "13 Sunday 9/10 08:20 Dallas Cowboys 40 " + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from Source.Predict import predict\n", + "\n", + "predict.get_games(week=1,season=2023)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "from Source.Predict import predict\n", + "predictions = []\n", + "for _,row in games.iterrows():\n", + " prediction = predict.predict(row['home'],row['away'],row['season'],row['week']+1, 45)\n", + " predictions.append(prediction)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
012
02023_2_ARI_WAS{'Winner': ['WAS'], 'Probabilities': [0.719565...{'Over/Under': ['Over'], 'Probability': [0.633...
12023_2_CAR_ATL{'Winner': ['ATL'], 'Probabilities': [0.596400...{'Over/Under': ['Over'], 'Probability': [0.876...
22023_2_CIN_CLE{'Winner': ['CLE'], 'Probabilities': [0.769957...{'Over/Under': ['Over'], 'Probability': [0.654...
32023_2_DAL_NYG{'Winner': ['DAL'], 'Probabilities': [0.548317...{'Over/Under': ['Over'], 'Probability': [0.653...
42023_2_DET_KC{'Winner': ['DET'], 'Probabilities': [0.518149...{'Over/Under': ['Over'], 'Probability': [0.566...
52023_2_GB_CHI{'Winner': ['GB'], 'Probabilities': [0.5585460...{'Over/Under': ['Under'], 'Probability': [0.88...
62023_2_HOU_BAL{'Winner': ['BAL'], 'Probabilities': [0.782784...{'Over/Under': ['Over'], 'Probability': [0.603...
72023_2_JAX_IND{'Winner': ['JAX'], 'Probabilities': [0.595993...{'Over/Under': ['Under'], 'Probability': [0.50...
82023_2_LA_SEA{'Winner': ['LA'], 'Probabilities': [0.5388965...{'Over/Under': ['Over'], 'Probability': [0.638...
92023_2_LV_DEN{'Winner': ['DEN'], 'Probabilities': [0.605623...{'Over/Under': ['Under'], 'Probability': [0.70...
102023_2_MIA_LAC{'Winner': ['LAC'], 'Probabilities': [0.599673...{'Over/Under': ['Over'], 'Probability': [0.522...
112023_2_PHI_NE{'Winner': ['NE'], 'Probabilities': [0.5209159...{'Over/Under': ['Over'], 'Probability': [0.537...
122023_2_SF_PIT{'Winner': ['SF'], 'Probabilities': [0.7199300...{'Over/Under': ['Under'], 'Probability': [0.60...
132023_2_TB_MIN{'Winner': ['TB'], 'Probabilities': [0.5235458...{'Over/Under': ['Over'], 'Probability': [0.543...
142023_2_TEN_NO{'Winner': ['NO'], 'Probabilities': [0.6887440...{'Over/Under': ['Over'], 'Probability': [0.742...
\n", + "
" + ], + "text/plain": [ + " 0 1 \\\n", + "0 2023_2_ARI_WAS {'Winner': ['WAS'], 'Probabilities': [0.719565... \n", + "1 2023_2_CAR_ATL {'Winner': ['ATL'], 'Probabilities': [0.596400... \n", + "2 2023_2_CIN_CLE {'Winner': ['CLE'], 'Probabilities': [0.769957... \n", + "3 2023_2_DAL_NYG {'Winner': ['DAL'], 'Probabilities': [0.548317... \n", + "4 2023_2_DET_KC {'Winner': ['DET'], 'Probabilities': [0.518149... \n", + "5 2023_2_GB_CHI {'Winner': ['GB'], 'Probabilities': [0.5585460... \n", + "6 2023_2_HOU_BAL {'Winner': ['BAL'], 'Probabilities': [0.782784... \n", + "7 2023_2_JAX_IND {'Winner': ['JAX'], 'Probabilities': [0.595993... \n", + "8 2023_2_LA_SEA {'Winner': ['LA'], 'Probabilities': [0.5388965... \n", + "9 2023_2_LV_DEN {'Winner': ['DEN'], 'Probabilities': [0.605623... \n", + "10 2023_2_MIA_LAC {'Winner': ['LAC'], 'Probabilities': [0.599673... \n", + "11 2023_2_PHI_NE {'Winner': ['NE'], 'Probabilities': [0.5209159... \n", + "12 2023_2_SF_PIT {'Winner': ['SF'], 'Probabilities': [0.7199300... \n", + "13 2023_2_TB_MIN {'Winner': ['TB'], 'Probabilities': [0.5235458... \n", + "14 2023_2_TEN_NO {'Winner': ['NO'], 'Probabilities': [0.6887440... \n", + "\n", + " 2 \n", + "0 {'Over/Under': ['Over'], 'Probability': [0.633... \n", + "1 {'Over/Under': ['Over'], 'Probability': [0.876... \n", + "2 {'Over/Under': ['Over'], 'Probability': [0.654... \n", + "3 {'Over/Under': ['Over'], 'Probability': [0.653... \n", + "4 {'Over/Under': ['Over'], 'Probability': [0.566... \n", + "5 {'Over/Under': ['Under'], 'Probability': [0.88... \n", + "6 {'Over/Under': ['Over'], 'Probability': [0.603... \n", + "7 {'Over/Under': ['Under'], 'Probability': [0.50... \n", + "8 {'Over/Under': ['Over'], 'Probability': [0.638... \n", + "9 {'Over/Under': ['Under'], 'Probability': [0.70... \n", + "10 {'Over/Under': ['Over'], 'Probability': [0.522... \n", + "11 {'Over/Under': ['Over'], 'Probability': [0.537... \n", + "12 {'Over/Under': ['Under'], 'Probability': [0.60... \n", + "13 {'Over/Under': ['Over'], 'Probability': [0.543... \n", + "14 {'Over/Under': ['Over'], 'Probability': [0.742... " + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import pandas as pd\n", + "pd.DataFrame(predictions)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +}