{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"<!-- <center><img src='https://www.nyrainc.com/assets/components/phpthumbof/cache/NYRA_Cares_810x430.d591d5ecfb0ffc5c0917ba2843346bc4.jpg'></center> -->\n<center><img src='https://storage.googleapis.com/kaggle-competitions/kaggle/37644/logos/header.png?t=2022-08-05-15-26-16'></center>\n\n<center><img src='https://cdn.dribbble.com/users/819689/screenshots/6176353/gallop.gif' width=800></center>\n\n<h1 style=\"color:#EE2737FF\"><center><font size=\"+6\">From \"कैन्टर\" - To - \"गैल्लोप\"</font></center></h1>\n\n<h3 style=\"text-align: right;color:rgb(0, 103, 71);\"><i>By: Kush Trivedi</i></h3>\n\n<h2 style=\"color:#EE2737FF\">About Me</h2>\n\nPlease, allow me to introduce myself I am **Kush Trivedi** I am a **self taught Machine Learning Engineer** and I am a highly motivated learner intrigued by all aspects of Big Data Analytics and I don't know much about the Derby so please pardon me in advance. However, my passion towards horse ridding draged me to participate here. Lastly, **I would love to hear you feedback** on my analysis and correct me if I am wrong at certain place. Thank you.\n\n<h2 style=\"color:#EE2737FF\">Goal of the Competition</h2> \n\nThe **goal** of this competition is to **analyze horse racing tactics**, **drafting strategies**, and **path efficiency**. You will develop a model using never-before-released coordinate data along with basic race information.\n\nYour work will help racing horse owners, trainers, and veterinarians better understand how equine performance and welfare fit together. With better data analysis, equine welfare could significantly improve.\n\n<h2 style=\"color:#EE2737FF\">Context</h2> \n\nInjury prevention is a critical component in modern athletics. Sports that involve animals, such as horse racing, are no different than human sport. Typically, efficiency in movement correlates to both improvements in performance and injury prevention.\n\nA wealth of data is now collected, **including measures for heart rate**, **EKG**, **longitudinal movement**, **dorsal/ventral movement**, **medial/lateral deviation**, **total power** and **total landing vibration**. Your data science skills and analysis are needed to decipher what makes the most positive impact.\n\nIn this competition, you will create **a model to interpret one aspect of this new data**. You’ll be among the first to access X/Y coordinate mapping of horses during races. Using the data, you might **analyze jockey decision making**, **compare race surfaces**, or **measure the relative importance of drafting**. With considerable data, contestants can flex their creativity problem solving skills.\n\nThe New York Racing Association (NYRA) and the New York Thoroughbred Horsemen's Association (NYTHA) conduct world class thoroughbred racing at Aqueduct Racetrack, Belmont Park and Saratoga Race Course.\n\nWith your help, NYRA and NYTHA will better understand their vast data set, which could lead to new ways of racing and training in a highly traditional industry. With improved use of horse tracking data, you could help improve equine welfare, performance and rider decision making.\n\n<h2 style=\"color:#EE2737FF\">Anout Dataset</h2> \n\n`track_id` - 3 character id for the track the race took place at.\n> **AQU -Aqueduct**\n\n> **BEL - Belmont**\n\n> **SAR - Saratoga** \n\n`race_date` - date the race took place. **YYYY-MM-DD**.\n\n`race_number` - Number of the race. Passed as 3 characters but **can be cast or converted to int** for this data set. \n\n`program_number` - **Program number of the horse** in the race passed as 3 characters. Should remain 3 characters as it isn't limited to just numbers. Is essentially the **unique identifier of the horse** in the race. \n\n`trakus_index` - The common collection of point of the **lat / long** of the horse in the race passed as an integer. From what we can tell, it's collected **every 0.25 seconds**.\n\n`latitude` - The **latitude of the horse** in the race passed as a float. \n\n`longitude` - The **longitude of the horse** in the race passed as a float.\n\n`distance_id` - **Distance** of the race **in furlongs** passed as an integer.\n> - Example - **600** would be **6** furlongs. \n\n`course_type` - The course the race was run over passed as one character.\n> **M - Hurdle**\n\n> **D - Dirt**\n\n> **O - Outer turf**\n\n> **I - Inner turf**\n\n> **T - turf** \n\n`track_condition` - The condition of the course the race was run on passed as three characters.\n> **YL - Yielding**\n\n> **FM - Firm**\n\n> **SY - Sloppy**\n\n> **GD - Good**\n\n> **FT - Fast**\n\n> **MY - Muddy**\n\n> **SF - Soft**. \n\n`run_up_distance` - **Distance** in **feet** of the **gate to the start** of the race passed as an integer. \n\n`race_type` - The classification of the race passed as as five characters. \n> **STK - Stakes**\n\n> **WCL - Waiver Claiming**\n\n> **WMC - Waiver Maiden Claiming**\n\n> **SST - Starter Stakes**\n\n> **SHP - Starter Handicap**\n\n> **CLM - Claiming**\n\n> **STR - Starter Allowance**\n\n> **AOC - Allowance Optionl Claimer**\n\n> **SOC - Starter Optional Claimer**\n\n> **MCL - Maiden Claiming**\n\n> **ALW - Allowance**\n\n> **MSW - Maiden Special Weight**. \n\n`purse` - Purse in **US dollars** of the race passed as an money with two decimal places.\n\n`post_time` - **Time of day** the race began passed as 5 character. \n> Example - **01220** would be **12:20**.\n\n`weight_carried` - An integer of the **weight carried by the horse** in the race. \n\n`jockey` - **Name of the jockey** on the horse in the race. 50 character max. \n\n`odds` - Odds to win the race passed as an integer. **Divide by 100 to derive the odds to 1**. \n>  - Example - **1280** would be **12.8-1**.\n\n`position_at_finish` - An integer of the horse's finishing position. (**added to the dataset 9/8/22**)\n\n<h2 style=\"color:#EE2737FF\">Sponsors</h2> \n\n**Thank you all for providing such a great opportunity. I really appreciate for this opprotunity.**\n\n<center><img src='https://i.postimg.cc/jSSW49JD/Untitled-drawio-removebg-preview.png', width=900></center>\n\n# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:15px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%;text-align:center\">Table of Contents</p></div>\n\n<h2 style=\"color:#EE2737FF\">★ Does Race Depends on Jockey or Tactics? What's your opnion?</h2>\n\n* [Import Libraries](#1)\n* [Data Loading](#2)\n* [Data Cleaning and Wrangling](#3)\n* [Helper Functions](#4)\n    * [Universal Summary Function for Data Frames](#4)\n    * [Universal Downcasting Memory Usage for Data Frames](#4)\n* [Downcasting Memory Usage](#5)\n* [Basic Summary of Start, Race, Tracking and Complete Dataset](#6)\n* [Advance Visualization EDA for New York Racing Association (2019)](#7)\n    1. [Race Track Inference](#7)\n    2. [Inference of Most Race by Month](#7)\n    3. [Race Course Type Inference](#7)\n    4. [Inference of Race Track Conditions](#7)\n    5. [Types of Race Inference](#7)\n    6. [Inference of Current Top - 10 Jockey's and thier 2019 Strategic Performance](#8)\n        * [Irad Ortiz, Jr](#9)\n        * [Joel Rosario](#10)\n        * [Luis Saez](#11)\n        * [Javier Castellano](#12)\n        * [Flavien Prat](#13)\n        * [Jose Ortiz](#14)\n        * [Jhon Velazquez](#15)\n        * [Manuel Franco](#16)\n        * [Dylan Davis](#17)\n        * [Tyler Gaffalione](#18)\n    7. [Top - 10 Jockey's Comparision Inference by Various Race Types of 2019](#19)\n        * [ALW - Allowance](#20)\n        * [AOC - Allowance Optionl Claimer](#21)\n        * [CLM - Claiming](#22)\n        * [MCL - Maiden Claiming](#23)\n        * [MSW - Maiden Special Weight](#24)\n        * [SOC - Starter Optional Claimer](#25)\n        * [STK - Stakes](#26)\n        * [STR - Starter Allowance](#27)\n        * [WCL - Waiver Claiming](#28)\n    8. [Inference of Top 20 jockeys by Major Race Types in 2019](#29)\n        * [ALW](#30)\n            * [Total Race Won](#30)\n            * [Place Winning Proportionality](#31)\n        * [AOC](#32)\n            * [Total Race Won](#32)\n            * [Place Winning Proportionality](#33)\n        * [CLM](#34)\n            * [Total Race Won](#34)\n            * [Place Winning Proportionality](#35)\n        * [MCL](#36)\n            * [Total Race Won](#36)\n            * [Place Winning Proportionality](#37)\n        * [MSW](#38)\n            * [Total Race Won](#38)\n            * [Place Winning Proportionality](#39)\n        * [SOC](#40)\n            * [Total Race Won](#40)\n            * [Place Winning Proportionality](#41)\n        * [SST](#42)\n            * [Total Race Won](#42)\n            * [Place Winning Proportionality](#43)\n        * [STK](#44)\n            * [Total Race Won](#44)\n            * [Place Winning Proportionality](#45)\n        * [STR](#46)\n            * [Total Race Won](#46)\n            * [Place Winning Proportionality](#47)\n        * [WCL](#48)\n            * [Total Race Won](#48)\n            * [Place Winning Proportionality](#49)\n    9. [Common Race Position Inference that Happens during ongoing Race](#50)\n        * [Race Summary](#51)\n        * [Top 3 Jockey Comparision with an Optimum Path](#52)\n            * [Typical Speed Time Curve](#53)\n            * [Speed Time Curve of Top 3 Jockey](#54)\n            * [Acceleration at Various Points on Race Track](#55)\n        * [Speed Time Curve of an Optimum Path](#56)\n            * [Comparision of Speed Time Curve of an Optimum Path with Top 3 Jockey](#57)\n            * [Sophisticated Speed Time Curve of Top 3 Jockey with Optimum Path](#58)\n        * [Win and Place Comparision with Optimum Path](#59)\n        * [Win and Show Comparision with Optimum Path](#60)\n        * [Show and Place Comparision with Optimum Path](#61)\n            \n* [Statistical Testing](#62) \n    * [Two related sample test on Speed](#63)\n    * [Two related sample test on Acceleration](#64)\n\n<h2 style=\"color:#EE2737FF\">★ Machine Learning</h2>\n\n* [Machine Learning Model](#65)\n* [Model Evaluation Metric](#66)\n* [Developing Own Model to Overcome Flaw in Basic Machine Learning Model](#67)\n* [Flask App](#68)\n\n\n# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '1'>1 |</b> Import Libraries</p></div>","metadata":{}},{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport glob\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport plotly.graph_objects as go\nimport matplotlib.patches as patches\nfrom plotly.subplots import make_subplots\nfrom matplotlib.ticker import AutoMinorLocator, MultipleLocator\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nplt.rcParams['figure.dpi'] = 150\nplt.rcParams[\"figure.figsize\"] = (10,5)\ncolors=sns.color_palette('Set3')\nsns.set(rc={\n    'axes.facecolor':'#FFFFFF', \n    'figure.facecolor':'#FFFFFF',\n    'font.sans-serif':'Arial',\n    'font.family':'sans-serif'\n})\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-10-13T21:37:09.641053Z","iopub.execute_input":"2022-10-13T21:37:09.641641Z","iopub.status.idle":"2022-10-13T21:37:10.995049Z","shell.execute_reply.started":"2022-10-13T21:37:09.641511Z","shell.execute_reply":"2022-10-13T21:37:10.993451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '2'>2 |</b> Data Loading</p></div>","metadata":{}},{"cell_type":"code","source":"# Dataset by NYRA\nstart_cols = ['track_id','race_date','race_number','program_number','weight_carried','jockey','odds','final_place']\nrace_cols = ['track_id','race_date','race_number','distance_id','course_type','track_condition','run_up_distance','race_type','purse','post_time']\ntracking_cols = ['track_id','race_date','race_number','program_number','trakus_index','latitude','longitude']\ncomplete_cols = ['track_id','race_date','race_number','program_number','trakus_index','latitude','longitude','distance_id','course_type','track_condition','run_up_distance','race_type','purse','post_time','weight_carried','jockey','odds','final_place']\n\nstart = pd.read_csv('../input/big-data-derby-2022/nyra_start_table.csv',names=start_cols)\nrace = pd.read_csv('../input/big-data-derby-2022/nyra_race_table.csv')\ntracking = pd.read_csv('../input/big-data-derby-2022/nyra_tracking_table.csv')\ncomplete = pd.read_csv('../input/big-data-derby-2022/nyra_2019_complete.csv', low_memory=False,index_col=False,header=None)\n\nrace.rename({i: col for i, col in enumerate(race_cols)}, axis=1, inplace=True)\ntracking.rename({i: col for i, col in enumerate(tracking_cols)}, axis=1, inplace=True)\ncomplete.rename({i: col for i, col in enumerate(complete_cols)}, axis=1, inplace=True)\n\nnew_complete = complete.copy()","metadata":{"execution":{"iopub.status.busy":"2022-10-13T21:37:10.997983Z","iopub.execute_input":"2022-10-13T21:37:10.999016Z","iopub.status.idle":"2022-10-13T21:37:41.506582Z","shell.execute_reply.started":"2022-10-13T21:37:10.998964Z","shell.execute_reply":"2022-10-13T21:37:41.505065Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '3'>3 |</b> Data Cleaning and Wrangling</p></div>","metadata":{}},{"cell_type":"code","source":"# Date Transformation\ncomplete['race_date']  = pd.to_datetime(complete[\"race_date\"], format='%Y-%m-%d')\ncomplete['year'] = complete[\"race_date\"].dt.year\ncomplete['month'] = complete[\"race_date\"].dt.month_name()\ncomplete['day_name'] = complete[\"race_date\"].dt.day_name()\n\n# Distance Transformation\ncomplete['furlongs'] = complete.distance_id / 100\ncomplete.drop('distance_id', axis=1, inplace=True)\n\n# Odds Transformation\ncomplete['new_odds'] = complete['odds'] / 100\ncomplete['new_odds'] = complete['new_odds'].apply(lambda x: round(x, 1))\ncomplete['new_odds'] = complete['new_odds'].astype(str)\ncomplete[\"new_odds\"] = complete[\"new_odds\"] + \"-1\"\ncomplete.drop('odds', axis=1, inplace=True)\ncomplete.rename(columns={'new_odds': 'odds'}, inplace=True)\n\n# Post Time Transformation\ndef insert_colon(string, integer):\n    return string[0:integer] + ':' + string[integer:]\n\ncomplete['post_time'] = complete['post_time'].astype(str)\ncomplete['post_time'] = complete['post_time'].apply(lambda x: insert_colon(x, -2))","metadata":{"execution":{"iopub.status.busy":"2022-10-13T21:37:41.508306Z","iopub.execute_input":"2022-10-13T21:37:41.508976Z","iopub.status.idle":"2022-10-13T21:38:06.825055Z","shell.execute_reply.started":"2022-10-13T21:37:41.508926Z","shell.execute_reply":"2022-10-13T21:38:06.823658Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '4'>4 |</b> Helper Functions</p></div>\n\n1. **Basic Summary Function**\n2. **Downcast Memory Usage Function**","metadata":{}},{"cell_type":"code","source":"def basicSummary(dataFrameForSummary):\n    print('\\n\\033[1;30;34mThis Datset consists of \\033[0;0m\\033[1m {}\\033[0m \\033[1;31;31mFeatures\\033[0;0m & \\033[1m{}\\033[0m \\033[1;31;32mSamples.\\033[0;0m\\n'.format(dataFrameForSummary.shape[1], dataFrameForSummary.shape[0]))\n    summary = pd.DataFrame(dataFrameForSummary.dtypes, columns=['Data Type'])\n    summary = summary.reset_index()\n    summary = summary.rename(columns={'index': 'Feature'})\n    summary['Num of Nulls'] = dataFrameForSummary.isnull().sum().values\n    summary['Num of Unique'] = dataFrameForSummary.nunique().values\n    summary['First Value'] = dataFrameForSummary.loc[0].values\n    summary['Second Value'] = dataFrameForSummary.loc[1].values\n    summary['Third Value'] = dataFrameForSummary.loc[2].values\n    summary['Fourth Value'] = dataFrameForSummary.loc[3].values\n    return summary\n\ndef downcastMemoryUsage(dataFrame):\n    startMemoryOptimization = dataFrame.memory_usage().sum() / 1024 ** 2\n    print('Memory usage of dataframe is: \\033[1m{:.2f} MB\\033[0m'.format(startMemoryOptimization))\n    subTypeInt = ['uint8','uint16','uint32','uint64','int8','int16','int32','int64']\n    subTypeFloat = ['float16','float32','float64']\n    for column in dataFrame.columns:\n        columnType = str(dataFrame[column].dtypes)\n        maximumColumn = dataFrame[column].max()\n        minimumColumn = dataFrame[column].min()\n        if 'int' in columnType:\n            for element in subTypeInt:\n                if minimumColumn > np.iinfo(element).min and maximumColumn < np.iinfo(element).max:\n                    dataFrame[column] = dataFrame[column].astype(element)\n                    break\n        elif 'float' in columnType:\n            for element in subTypeFloat:\n                if minimumColumn > np.finfo(element).min and maximumColumn < np.finfo(element).max:\n                    dataFrame[column] = dataFrame[column].astype(element)\n                    break\n        elif 'object' in columnType:\n            numberOfUnique = len(dataFrame[column].unique())\n            numberOfTotal = len(dataFrame[column])\n            if numberOfUnique / numberOfTotal < 0.5:\n                dataFrame[column] = dataFrame[column].astype('category')\n    endMemoryOptimization = dataFrame.memory_usage().sum() / 1024 ** 2\n    print('Memory usage after optimization is: \\033[1m{:.2f} MB\\033[0m'.format(endMemoryOptimization))\n    print('Compressed by: \\033[1m{:.2f} %\\033[0m'.format(100*(startMemoryOptimization - endMemoryOptimization) / startMemoryOptimization))\n    return dataFrame","metadata":{"execution":{"iopub.status.busy":"2022-10-13T21:38:06.826864Z","iopub.execute_input":"2022-10-13T21:38:06.827303Z","iopub.status.idle":"2022-10-13T21:38:06.843065Z","shell.execute_reply.started":"2022-10-13T21:38:06.827266Z","shell.execute_reply":"2022-10-13T21:38:06.841629Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '5'>5 |</b> Downcasting Memory Usage</p></div>","metadata":{}},{"cell_type":"code","source":"print(\"\\033[1;30;34mStart Dataset Downcasting \\033[0;0m\")\nstart = downcastMemoryUsage(start)\nprint(\"\\n\\033[1;30;34mRace Dataset Downcasting \\033[0;0m\")\nrace = downcastMemoryUsage(race)\nprint(\"\\n\\033[1;30;34mTracking Dataset Downcasting \\033[0;0m\")\ntracking = downcastMemoryUsage(tracking)\nprint(\"\\n\\033[1;30;34mComplete Dataset Downcasting \\033[0;0m\")\ncomplete = downcastMemoryUsage(complete)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-10-13T21:38:06.845421Z","iopub.execute_input":"2022-10-13T21:38:06.846596Z","iopub.status.idle":"2022-10-13T21:38:33.233126Z","shell.execute_reply.started":"2022-10-13T21:38:06.846551Z","shell.execute_reply":"2022-10-13T21:38:33.231615Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '6'>6 |</b> Summary of Datasets</p></div>","metadata":{}},{"cell_type":"code","source":"# Start\nfig = make_subplots(rows=1, cols=2)\nfig.update_layout(\n    title_text=\"<b>Start Dataset Summary</b>\",\n    title_x=0.5\n)\nfig['layout']['title']['font'] = dict(size=35, color='rgba(238, 39, 55, 1.00)')\nfig.add_trace(go.Indicator(mode = \"number\", value = start.shape[0], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Rows (Samples)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0, 0.5], 'y': [0.1, 1]}))\nfig.add_trace(go.Indicator(mode = \"number\", value = start.shape[1], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Columns (Features)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0.5, 1], 'y': [0, 0.4]}))\nfig.show()\ndisplay(basicSummary(start))\n\n# Race\nfig = make_subplots(rows=1, cols=2)\nfig.update_layout(\n    title_text=\"<b>Race Dataset Summary</b>\",\n    title_x=0.5\n)\nfig['layout']['title']['font'] = dict(size=35, color='rgba(238, 39, 55, 1.00)')\nfig.add_trace(go.Indicator(mode = \"number\", value = race.shape[0], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Rows (Samples)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0, 0.5], 'y': [0.1, 1]}))\nfig.add_trace(go.Indicator(mode = \"number\", value = race.shape[1], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Columns (Features)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0.5, 1], 'y': [0, 0.4]}))\nfig.show()\ndisplay(basicSummary(race))\n\n# Tracking\nfig = make_subplots(rows=1, cols=2)\nfig.update_layout(\n    title_text=\"<b>Tracking Dataset Summary</b>\",\n    title_x=0.5\n)\nfig['layout']['title']['font'] = dict(size=35, color='rgba(238, 39, 55, 1.00)')\nfig.add_trace(go.Indicator(mode = \"number\", value = tracking.shape[0], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Rows (Samples)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0, 0.5], 'y': [0.1, 1]}))\nfig.add_trace(go.Indicator(mode = \"number\", value = tracking.shape[1], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Columns (Features)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0.5, 1], 'y': [0, 0.4]}))\nfig.show()\ndisplay(basicSummary(tracking))\n\n# Complete\nfig = make_subplots(rows=1, cols=2)\nfig.update_layout(\n    title_text=\"<b>Complete Dataset Summary</b>\",\n    title_x=0.5\n)\nfig['layout']['title']['font'] = dict(size=35, color='rgba(238, 39, 55, 1.00)')\nfig.add_trace(go.Indicator(mode = \"number\", value = complete.shape[0], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Rows (Samples)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0, 0.5], 'y': [0.1, 1]}))\nfig.add_trace(go.Indicator(mode = \"number\", value = complete.shape[1], number={'font':{'color': 'rgb(0, 103, 71)','size':100}}, title = {\"text\": \"Columns (Features)<br><span style='font-size:0.8em;color:rgb(0, 35, 156)'>In the Dataframe</span>\"}, domain = {'x': [0.5, 1], 'y': [0, 0.4]}))\nfig.show()\ndisplay(basicSummary(complete))","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-10-13T21:38:33.234597Z","iopub.execute_input":"2022-10-13T21:38:33.234987Z","iopub.status.idle":"2022-10-13T21:38:35.427595Z","shell.execute_reply.started":"2022-10-13T21:38:33.234952Z","shell.execute_reply":"2022-10-13T21:38:35.426044Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '7'>7 |</b> Advanced EDA</p></div>\n\n<center><h2 style=\"color:#EE2737FF\"><font size=\"+3\">New York Racing Association (2019) - Exploratory Data Analysis</font></h2></center>\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font size=\"+3\">After Extensive Data Pre-Processing for Every Race in 2019</font></span> </b></center></h3>\n\n<center><img src='https://media-s3-us-east-1.ceros.com/cognism/images/2022/03/01/ef89201d12e5eebd3dfffc5b9789bf43/the-scientist-male-animation.gif'></center>\n\n\n\n★   **Racing Track Inference:-** It can be seen that the majority of the race were ran at **` AQU - Aqueduct `**, with **` BEL - Belmont `** coming in second and **` SAR - Saratoga `** at last.\n\n★  **Inference of Most Race by Month:-** The majority of the races are scheduled for the **` Fall `**, followed by the **` Summer`**, and **` Winter`**.\n\n![](https://i.postimg.cc/XNfZLgJG/track-months.png)\n\n★  **Race Course Type Inference:-** **80%** of time Race Course is either **` D- Dirt`** or **` T - Turf`** with dirt accounting for **62%** of the time.\n\n* > **Inference of Race Track Condition:-** Only **14%** of the time conditions are **` GD - Good`**, yet over **80%** of the race track is **FT - Fast`** and **FM - Firm`**. \n>> - This could be a **main feature to focus** for **Horse health**.\n\n![](https://i.postimg.cc/fL0dMnDB/couse-track.png)\n\n★  **Types of Race Inference:-** **` CLM - Clamming`** is frequently the first of **12** different race categories, followed by **` MSW - Maiden Special Weight`** and **` MCL - Maiden Claiming`**.\n>> - **CLM - Claming** is a race in which **every horse** running **can be \"Claimed\"** or **purchased** after the race.\n>> - **MLW - Maiden Soecial Weight** is a highest caliber of maiden race in North America where all the **entrants carry a fixed amount of weight**.\n>>> * **Feature to note for speed and health of horse.**\n>> - **MCL - Maiden Claming** is a race for the **horses** that have **never won a race** and are **eligible to be claimed**.\n\n![](https://i.postimg.cc/RhLN0v8Q/race-types.png)\n\n<center><h2 style=\"color:#EE2737FF\"><font id='8' size=\"+3\">Current Top 10 Jockey by their 2019 Results</font></h2></center>\n\n★  **Inference of Current Top-10 Jockeys:-** Although the jockey's **performances are nearly identical**, according to the [NYRA current jockey ranking](https://www.nyra.com/saratoga/leaders/jockeys/), I have examined the current entire dataset in another file and included a summary of it. However, there are a **few exceptions** **(**Marked as **'⚠️'** in table **)** or either the data is not fully provided there can be some **data discrepancy** while providing it.\n\n**PS Note:** This notebook was created in **month of August** and it might **not** match **Current Ranking** of the Jockey. However, I have found some interesting things that **may effect** current Rankings.\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font size=\"+3\">Table highlight's the Current Top 10 Jockey's Race Starts in 2019</font></span> </b></center></h3>\n\n<style type=\"text/css\">\n      table {\n        width: 100%;\n        padding: 0;\n        margin: 0;\n        border: 0;\n        border-collapse: collapse;\n      }\n\n      td {\n        width: 176px;\n        padding: 0 10px 0 0;\n        margin: 0;\n        border: 0;\n      }\n      td.last {\n        padding: 0;\n        margin: 0;\n        border: 0;\n      }\n</style>\n    \n<font size=\"3\">\n    <table style=\"border:1px solid black;\">\n        <tr>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b> Jockey </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   ALW  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   AOC  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   CLM  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   MCL  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   MSW  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   SHP  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   SOC  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   SST  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   STK  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   STR  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   WCL  </b></center></span></td>\n            <td style=\"border:2px solid black;\"><span style='color:rgb(0, 35, 156);'><center><b>   WMC  </b></center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#D34F73FF'><center><b>Irad Ortiz Jr</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>91</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>113</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>145</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>94</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>177</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>5</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>139</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>33</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>4</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#008C76FF'><center><b>Joel Rosario</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>59</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>83</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>112</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>66</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>183</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>118</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#E95C20FF'><center><b>Luis Saez</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>64</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>74</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>127</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>93</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>161</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>3</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>105</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>33</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>5</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#963CBDFF'><center><b>Flavien Prat ⚠️</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>2</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>4</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: #00B1D2FF'><center><b>7</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#2C5F2DFF'><center><b>Javier Castellano</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>58</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>67</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>58</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>44</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>169</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>2</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>119</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>23</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#DAA03DFF'><center><b>Jose L. Ortiz</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>76</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>99</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>110</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>65</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>190</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>129</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>30</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>2</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#783937FF'><center><b>Manuel Franco</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>131</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>144</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>285</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>208</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>275</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>2</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>17</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>151</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>53</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>7</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#6E8898FF'><center><b>John R. Velazquez</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>55</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>61</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>22</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>12</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>140</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>5</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>113</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>10</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#A13941FF'><center><b>Tyler Gaffalione ⚠️</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>14</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>14</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>29</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>23</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>48</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>31</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>7</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>-</center></span></td>\n        </tr>\n        <tr>\n            <td style=\"border-left:2px solid black;\"><span style='color:#28334AFF'><center><b>Dylan Davis</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>108</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>115</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:#00B1D2FF'><center><b>284</b></center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>198</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>235</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color:black'><center>1</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>13</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>8</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>91</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>47</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>7</center></span></td>\n            <td style=\"border-left:2px solid black;\"><span style='color: black'><center>1</center></span></td>\n        </tr>\n    </table>\n</font>\n\n* > We can assume by the data that **Javier Castellano** and **John R. Velazquez** have almost participated in same race category if we can have more data resource regarding horse name we can leverage odds value to predict it. Similarly, **Joel Rasario**, **Luis Saez** and **Jose L Ortiz** have same trend in particiaption in different race category. Lastly, **Manuel Franco** and **Dylan Davis** has participated in almost all race category so the data could be little bias so if we are preparing a model for race category we can **drop some of the feature** such as **SST**, **WMC** etc Also **we can prove that** the the **most of the data** is all about **CLM**, **MSW**, and **STK** from **type of race inference**. To **Note:** The Current Champion **Irad Ortiz Jr** has participated in almost every race with equally. It seems to me he has more experence in all type of race track conditions maybe that's why he is currently standing at [1st Place](https://www.nyra.com/saratoga/leaders/jockeys/). Needless, to say that I think that the there is some data discrepancy for **⚠️ Flavien Prat ⚠️** and **⚠️ Tyler Gaffalione ⚠️**.\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font size=\"+3\">Win, Place and Top3 Analysis for Cureent Top 10 Jockeys</font></span> </b></center></h3>\n\n![](https://i.postimg.cc/7YW8Cspv/initial-2.png)\n\n* > The following bar chart indicates that **Manuel Franco** has won a total of **620 races**, while **Dylan Davis** has won **436** of them. As I mentioned previously, the statistics may be **slightly biased** in **favor** of Manuel Franco and Dylan Davis. If we **look at each stack of bars separately**, they are **practically identical** in **proportion**. Since the present dataset has more information about them, **we cannot conclude that they are both skilled jockeys**. Additionally, we can **determine** their **proponality** and **evaluate** their **strategic effectiveness**.\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font size=\"+3\">Win, Place and Top3 Proponality  for Curent Top 10 Jockeys</font></span> </b></center></h3>\n\n![](https://i.postimg.cc/YCTHPn3N/initial-3.png)\n\n* > As I mentioned earlier, Manuel Franco and Dylan Davis may not be as skilled jockeys, as the winning probabilities; **48.67%** for **Manuel Franco** and **39.35%** for **Dylan Davis** justifies that. Additionally, it's interesting to note that **despite having competed** in **fewer races**, **Irad Ortiz Jr. (53.99%)**, **Joel Rosario (52.67%)**, and **in particular Javier Castellano (54.71%)** had higher **winning probabilities** and it can be seen in the [current jockeys rankings](https://www.nyra.com/saratoga/leaders/jockeys/). So, I believe these **jockeys are safe to bet initially** as there are lot of factors to has be seen before betting and will discuss all of them step by step. \n\n![](https://i.postimg.cc/KYz4Nv7s/irad-ortiz-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='9' size=\"+3\">Irad Ortiz. Jr: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F18b3425fcf9982bd5e4c499c2e233300%2Fi1.png?generation=1663725012266164&alt=media)\n\n★  **Irad Ortiz** competes most **frequently** in **MSW**, **CLM**, and **STK**, where his **performance is indistinguishable**. However, if we pay close attention, he does well in **CLM** and is nearly in the top three for other race types. Further we will compare him to other jockeys below in the comparison section.\n\n![](https://i.postimg.cc/vHynwNjt/joel-rosario-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='10' size=\"+3\">Joel Rosario: Strategic Perfromace in 2019</font></span> </b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F2e04f95328a49e2fb6b40a0bafc82ec1%2Fjr2.png?generation=1663725516102138&alt=media)\n\n★  Similarly, **Joel Rosario** competes most **frequently** in **MSW**, **CLM**, and **STK**, where his **performance is extraordinary** in **STK** and we will compare him with other jockeys below in the comparison section.\n\n![](https://i.postimg.cc/P53vZrqS/luis-saez-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='11' size=\"+3\">Luis Saez: Strategic Perfromace in 2019</font></span> </b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F264622fd4b06186953d183f91d3801cc%2Fls1.png?generation=1663725778694571&alt=media)\n\n★  **Luis Saez**: who primarily participates in the **STK**, **MSW**, and **CLM** events, **seems** to be **quite unpredictable**. He does well in the **MCL**, **STK**, and **ALW**, but we will also compare him to other jockeys in the comparison section.\n\n![](https://i.postimg.cc/mg2FtFTc/javier-castellano-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='12' size=\"+3\">Javier Castellano: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fb0f77f474500ae0ea3498ed4ec8ff266%2Fjc2.png?generation=1663726232956583&alt=media)\n\n★  **Javier Castellano**: who primarily participates in the **STK**, **MSW**, and **CLM** events where his **performance is indistinguishable** too. Moreover, he has good **winning probability** in **MSW** and **CLM**.\n\n![](https://i.postimg.cc/9057M8fV/falvuen-prat-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='13' size=\"+3\">Falvien Prat: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Ff3daf16f82a747ee2fb333c0b1efefb9%2Ff1.png?generation=1663726450052828&alt=media)\n\n★  As we have data descripency for **Falvien Prat** we can not make any decisions on it if we can have more resource regarding him we can make some data inspired decisions.\n\n\n![](https://i.postimg.cc/m2SHLSWf/jose-ortiz-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='14' size=\"+3\">Jose Ortiz: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F549296bbbf7be273e29d28a4eb2a1856%2FJO1.png?generation=1663726659777362&alt=media)\n\n★  **Jose Ortiz**: competes most **frequently** in **MSW**, **CLM**, and **STK**. Additionally, it is important to note that, in comparison to other race types, his performance in the **AOC** was strong.\n\n![](https://i.postimg.cc/3rmG6TLw/john-velazquez-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='15' size=\"+3\">John Velazquez: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F22080287a4763c69c21c1df62bc5b649%2FJV1.png?generation=1663727961565349&alt=media)\n\n★  **John Velazquez**: who primarily participates in the **MSW**, **STL**, and **ALW** being said that I would also like to emphasize that even though he didn't participate as much in **MCL**, he still performed well there. We'll compare him to other jockeys below in the comparison section.\n\n![](https://i.postimg.cc/tg81SSWP/manuel-franco-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='16' size=\"+3\">Manuel Franco: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F340b921cd504b85a9f22a34727bf813d%2FFM1.png?generation=1663728318802158&alt=media)\n\n★  **Manuel Franco**: also has participated mostly not mostly in  **CLM**, **MSW**, and **MCL**. Nevertheless, even though he primarily competed in those categories, his performance in **AOC** was far better.\n\n![](https://i.postimg.cc/C5GffGZ8/dylan-davis-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='17' size=\"+3\">Dylan Davis: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F64619a8f0e06967107fd4b31447d33a6%2FDD1.png?generation=1663728329828205&alt=media)\n\n★  **Dylan Davis**: also has participated mostly not mostly in  **CLM**, **MSW**, and **MCL**. However, even though he primarily competed in those categories, his performance in **SOC** was far better.\n\n![](https://i.postimg.cc/7hk5D5BZ/tyler-gaffalione-total.png)\n\n<h3><center><b><span style='color:rgb(0, 103, 71);'><font id='18' size=\"+3\">Tyler Gaffalione: Strategic Perfromace in 2019</font></span></b></center></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F4c756293bf2bcd73a051526cba1bf1ab%2FTF1.png?generation=1663727845718351&alt=media)\n\n★  As we have data descripency for **Tyler Gaffalione** we can not make any decisions on it if we can have more resource regarding him we can make some data inspired decisions.\n\n<center><h2 style=\"color:#EE2737FF\"><font id='19' size=\"+3\">Current Top 10 Jockey Comparison by Various Race Types of 2019</font></h2></center>\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='20' size=\"+3\">1. ALW - Allowance</font></span></b></h3>\n\n<center><img src=\"https://media.istockphoto.com/vectors/race-horse-vector-id499810472?k=20&m=499810472&s=612x612&w=0&h=rV1K9S8WzVTM5_uqmJ7J6LLmMyPY3fc_jElQCs4IPIk=\"></center>\n\n★  **Joel Rosario**, **Irad Ortiz Jr.**, **Jose Ortiz**, **John R. Velazquez**, and **Luis Saez** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fdb2b1996fe049134f5ef92fa7baffc49%2Fnew_alw.png?generation=1663728801077705&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='21' size=\"+3\">2. AOC - Allowance Optionl Claimer</font></span></b></h3>\n\n<center><img src=\"https://i.postimg.cc/PqqSRf8v/4-removebg-preview.png\" height=700, width=500></center>\n\n★  **Jose Ortiz**,**Irad Ortiz Jr.**, and **Joel Rosario**,are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fc98c5267f9b5ec875f58de76d49b1d26%2Fnew_aoc_1.png?generation=1663729163843458&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='22' size=\"+3\">3. CLM - Claiming</font></span></b></h3>\n\n<center><img src=\"https://i.postimg.cc/9f1tDSxG/kk.png\" height=900, width=800></center>\n\n★  **Javier Castellano**, **Jose Ortiz**,**Irad Ortiz Jr.**, and **John R. Velazquez**,are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F8e0b0d5855f7f11ba714b00a8530d560%2Fnew_clm.png?generation=1663729773898405&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='23' size=\"+3\">4. MCL - Maiden Claiming</font></span></b></h3>\n\n<center><img src=\"https://media.istockphoto.com/vectors/thoroughbred-horse-racing-horseracing-vector-id476250498?k=20&m=476250498&s=170667a&w=0&h=Jqc0-aV8PWEEZYaGry8OSmVRZtDBqDGICqRC6QiMj1k=\" height=900, width=500></center>\n\n★  **Joel Rosario**,**Irad Ortiz Jr.**, **John R. Velazquez**, and **Luis Saez** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F918b46ae25238cd96479653473ae8d8a%2Fnew_mcl.png?generation=1663729997981043&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='24' size=\"+3\">5. MSW - Maiden Special Weight</font></span></b></h3>\n\n<center><img src=\"https://static.vecteezy.com/system/resources/previews/002/756/035/original/horse-racing-with-a-jockey-from-splash-of-watercolors-colored-drawing-realistic-horseback-riding-illustration-of-paints-vector.jpg\" height=800, width=500></center>\n\n★  **Javier Castellano**, **Joel Rosario**,**Irad Ortiz Jr.**, **John R. Velazquez**, and **Jose Ortiz** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F7afd8e1fcbd06a894532b8d4bed8f7b0%2Fnew_msw.png?generation=1663730214069595&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='25' size=\"+3\">6. SOC - Starter Optional Claimer</font></span></b></h3>\n\n<center><img src=\"https://i.pinimg.com/474x/af/ab/4a/afab4afd2c9d1050675194c20043f165.jpg\" height=800, width=500></center>\n\n★  **Irad Ortiz Jr.**, **Dylan Davis**, and **Manuel Franco** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F48796ec1f4f9b6c7c2e57652009fd099%2Fnew_soc.png?generation=1663731062270976&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='26' size=\"+3\">7. STK - Stakes</font></span></b></h3>\n\n<center><img src=\"https://i.postimg.cc/HxyNbdFq/kk1-1-removebg-preview.png\" height=800, width=500></center>\n\n★  **Falvien Prat**,**Javier Castellano**, **Irad Ortiz Jr.**, and **Joel Rosario** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Ffb3f58e57d8ebc58a7151093c37902c2%2Fnew_stk.png?generation=1663731359013223&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='27' size=\"+3\">8. STR - Starter Allowance</font></span></b></h3>\n\n<center><img src=\"https://i.postimg.cc/CLqKdqv7/kk2-removebg-preview.png\" height=800, width=500></center>\n\n★  **Joel Rosario** ,**Javier Castellano**, **Irad Ortiz Jr.**, **John R. Velazquez**, and **Jose Ortiz** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fcda525789f8d0cc267babfa078520ffb%2Fnew_str.png?generation=1663731513070018&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='28' size=\"+3\">9. WCL - Waiver Claiming</font></span></b></h3>\n\n<center><img src=\"https://i.postimg.cc/qBXTFxZ9/ll-copy.png\" height=800, width=500></center>\n\n★  **Irad Ortiz Jr.**, **Dylan Davis**, and **Manuel Franco** are safe bets, based on their **winning %** performance. Notably, \"**nan**\" denotes a situation in which the jockey has competed once and won at that position, while \"**green box**\" indicates the jockey's maximum value at that specific position in the upper table,and we must concentrate on the lower table because it represents their entire winning performance before we make any decisions for their performance etc.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F512a29f33d97a18d27b762059277989e%2Fnew_wcl.png?generation=1663731772361719&alt=media)\n\n<center><h2 style=\"color:#EE2737FF\"><font id='29' size=\"+3\">Top 20 Jockeys for Major Race Types in 2019</font></h2></center>\n \n★  **Top 20 Jockey Performance for Each Race Type Inference:-** Nearly all of the top 10 jockeys in the league are present here, but the most crucial thing to note is that **Jose Lezcano**, **Junior Alvarado**, **Kendrick Carmochue**, and **Benjamin Hernandez** are jockeys that could be a Jack Card and it could be seen in the [current jockeys rankings](https://www.nyra.com/saratoga/leaders/jockeys/) where **Jose Lezcano** gets into Top 10. Also, please always refer to the Winning Proportionality charts for different race types.\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='30' size=\"+3\">★ ALW: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F952f35dacfd496f5ec50bb1c00f1f122%2Falw_number.png?generation=1663634972406990&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='31' size=\"+3\">★ ALW: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F4cc11e99a60520773aee2f4481dc9909%2Fnew_alw.png?generation=1663737450488658&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='32' size=\"+3\">★ AOC: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F7625b1dddf9b198919092e6143024712%2Faoc_number-min.png?generation=1663636400997134&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='33' size=\"+3\">★ AOC: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Ff95281e0cd7bf6040d6b08e7e535eea4%2Faoc.png?generation=1663737567367091&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='34' size=\"+3\">★ CLM: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F826d3a5f3ccb6abb902e0b30cf817975%2Fclm_number-min.png?generation=1663636426924318&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='35' size=\"+3\">★ CLM: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F45601c86b775fcdcfdecacd65cc45891%2Fmlc.png?generation=1663905512426920&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='36' size=\"+3\">★ MCL: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fb490b9c24e82c1016017b23557ac3b0c%2Fmcl_number-min.png?generation=1663639777528769&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='37' size=\"+3\">★ MCL: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fa415614e445565f84e410faec9d8e2b3%2Flcm.png?generation=1663905442273236&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='38' size=\"+3\">★ MSW: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fa25e160684cddc456e3f0d1e2fcef374%2Fmsw_number-min.png?generation=1663639822245982&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='39' size=\"+3\">★ MSW: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F07d677b550806434e653c9ea89e22cac%2Fmsw.png?generation=1663737732510515&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='40' size=\"+3\">★ SOC: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fa10104c052616b9e11514442cf187e2d%2Fsoc_number-min.png?generation=1663639894254396&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='41' size=\"+3\">★ SOC: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fbe4a06bd99c86164f0904d6d45568449%2Fsoc.png?generation=1663737772477523&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='42' size=\"+3\">★ SST: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fb6b5c905dd6b8ded7417d25ea50f35bd%2Fsst_number-min.png?generation=1663639931611660&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='43' size=\"+3\">★ SST: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F3359eac4e34e8dfdb01b4be0b914d868%2Fsst.png?generation=1663737818102489&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='44' size=\"+3\">★ STK: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F9c88fdf096a976e2d6bc5f0d6d5735bc%2Fstk_number-min.png?generation=1663639986291324&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='45' size=\"+3\">★ STK: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fa1711854148d2983c11acdc54ed06257%2Fstk.png?generation=1663737865674405&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='46' size=\"+3\">★ STR: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F65c8672383593d3bd514db302a6a18b3%2Fstr_number-min.png?generation=1663640384615890&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='47' size=\"+3\">★ STR: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F26bf63240092f99bd06f62b6c8d0e36d%2Fstr.png?generation=1663737903561509&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='48' size=\"+3\">★ WCL: Total Race Won</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F0b89458048b6882c8bce8e849a766134%2Fwcl_number_final.png?generation=1663640485476029&alt=media)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='49' size=\"+3\">★ WCL: Place Wining Proportionality</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F46807f6865b378b3befa2f4bd2744003%2Fwcl.png?generation=1663737940770044&alt=media)\n\n<center><h2 style=\"color:#EE2737FF\"><font id='50' size=\"+3\">Visualizing Typical Scenerio that Happens During the Race</font></h2></center>\n\nHere we will analyze the Race that happned at **Saratoga on 27th July 2019** for **understanding purpose** as this **race has most common scenerio** that **happens during ongoing race** and we will visulize it step by step. **Video** of race can be find [**here**](https://youtu.be/-OId_SqGt_I?t=2142)\n\n<h3><b><span style='color:rgb(0, 103, 71);'><font id='51' size=\"+3\">Race Summary</font></span></b></h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Feda78a7241a08aff64f3bc9b521d7c51%2FFinal_Sar_Summary.png?generation=1666467906484458&alt=media)\n\nAs show above in the picture I have created a function that calculates **Average Speed of Horse**, **Average Acceleration** and **Approx Time Taken**. The result are **almost matching to the actual results**. Moreover, once we got this crucial parameters we will **leverage it to find the optimum path** and will **compare it to each individuals performance**. But before that lets have look to **breif summary** of the picture mentioned above.\n\n★ **Results**\n* **Rank 1:** Joel Rosario\n    * Average Speed: **38.56 mph**\n* **Rank 2:** Javier Castellano\n    * Average Speed: **38.54 mph**\n* **Rank 3:** Manuel Franco\n    * Average Speed: **38.55 mph**\n* **Rank 4:** Tyler Gaffalione\n    * Average Speed: **38.41 mph**\n* **Rank 5:** Dylan Davis\n    * Average Speed: **38.37 mph**\n* **Rank 6:** Jose L. Ortiz\n    * Average Speed: **38.07 mph**\n* **Rank 7:** Junior Alvarado\n    * Average Speed: **36.78 mph**\n        \nHmm, looks like **higher the speed better the winning position**. However, that is not true in every case so let's analyse it further with little more in-depth with more animation along with optimum path.\n\nBut **what is Optimum Path? How can I find one?** \n\nIn **simple words** there can be **N number of paths** in a **N number of tracks** also there are **N number of maths**, **physics** and **personal reasearch** done by **N number of competitors** in this **competition**. However, the question is **what could be the best optimum path?** Simply, In **my personal opinion** I would say that **sometimes implementing simple logic is better than using complex theory or partical concept** by this, I mean that the **jockey who won the race would have undoubtedly followed the best route**, **strategy**, and **other tactics**. Therefore, by **extracting data** from various **race variables**, we **may identify** the **Optimum Path**. For an instance extract data by **track_id**, **furlongs**, **course_type**, **track_condition**, and **finishing_place**.\n\n**Contrarily**, In the views of the **other people** and **competitors** can state that **each horse is unique**, with some taking **large stides / gait pattern** and others taking **smaller** ones. Some jockeys **may have achieved victories through pure chance** or other **unforeseeable circumstances**. So people **may debate on my findings for optimum path strategy** however I can prove them with **statical significant test**.\n\nSo, after **carefully examining** of the **derby coordinates data** for the **victorious jockeys (1st Place)**, I discovered that the **data is not distributed symmetrically it's a skewed distribution**, making it a **bad idea to take the Mean** coordinates to get Optimum Path. **Instead, we should take the coordinates Median**, and not only but also when we have a skewed distribution, the **median is a better measure of central tendency than the mean** also by taking Median it will help us **avoid the contrary situation** mentioned above.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='52' size=\"+3\">Top 3 Jockey Comparision with an Optimum Path</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F1964d5604572d85faaaae124899d70d1%2Ffinal_all.gif?generation=1667443953079954&alt=media)\n\nAs in the animation above, if **we look closely**, we can observe a **ranking difference between** the **jockeys** for **every four dashes**. I know it hard to understand and **waste of time to look at animation for few seconds**. Therefore, let's **simplify** it by providing several key **speed-time concepts** together with their typical **curves** to have a more in-depth comprehension.\n\n★ **Brief Note:** If we look at the **first four dash** of ongoing animation we can see **Joel Rosario** had a **good start** and **Javier Castellano** was also having **good start**. However, **Manuel Franco** did **not had good start** compare to **both** of them. Furthermore, **if we look just before the turn in point** something happned where **Manuel Franco** took lead on **Javier Castellano**. Moreover, **Joel Rosario** was leading the race all time. [**Detailed Explanation of that scenerio is discussed here**](https://www.kaggle.com/competitions/big-data-derby-2022/discussion/355204). Though **Manuel Franco** took at lead at turn in point it **didn't lasted long as he looses the lead at the exit point** that can bee seen in above visualization. I still know it bit confusing so lets analyze it **more efficently with speed time curve**.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='53' size=\"+3\">Typical Speed Time Curve</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F8aba1981983c84423c7579bcb340233e%2FSpeed-time-curve.jpeg?generation=1665796320262949&alt=media)\n\nIn essence, a typical speed time curve shows that traveling **from point 0 to A in 0 to t1 time** is referred to as a **rehostatic acceleration** (**Constant Acceleration**). This is frequently the **starting line of a race**, and somewhat **staright path**. We can now see a curve forming **from point A to point B**, which depicts that **speed on the curve**; **B to point C** is known as **free running on the curve**; **C to point D** is known as **coasting**; and, finally, **point D to point E** is a **braking point**, where body speed and acceleration are reduced to take a **wider** or **shorter turn**. Now, lets look the speed time curve for top 3 jockey.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='54' size=\"+3\">Speed Time Curve of Top 3 Jockey</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F110b848c959f5fb26f3b8f44a610760b%2Fjoel_vs_jaiver_vs_manuel.png?generation=1667445005224393&alt=media)\n\nAs shown above in the picture now it **makes more sense what typicaly happned at the various curve point of Speed Time curve** and it seems like the **one who has good acceleration at start**, **after braking point**, and **at exit point** wins the race.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='55' size=\"+3\">Acceleration at Various Points on Race Track</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fe4464de08d7f44904e28dca61f7ae604%2Fjoc_acc_on_track.png?generation=1667447093080173&alt=media)\n\nThe visualization shown above makes it very **evident** that **Joel Rosario** had **strong acceleration** following the braking point and **maintained his lead** throughout the remainder of the race. Furthermore, if we compare **Javier Castellano** and **Manuel Franco**, we can see that **Manuel took the lead at curvature** since it was clear that Manuel would get benefit at the curve as he was **taking wider turn** and **apexing late**. However, **Javier** accelerated at the **exit point** and **took** the **lead** after **Manuel made a mistake** at the **exit point**, which caused him to loose the race. **Simple Right? Answer is NO**. this could be **one scenerio** but there **might be multiple scenerio** and **unforeseeable circumstances**. So, let's look at that by comparing with optimum path data.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='56' size=\"+3\">Speed Time Curve of an Optimum Path</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F7999f2c8e93266b676ea248efaf218c0%2Foptimum_six_on_dirt_sar.png?generation=1667448393754638&alt=media)\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='57' size=\"+3\">Comparision of Speed Time Curve of an Optimum Path with Top 3 Jockey</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F33fd50c741a6e5bac4dbebd80676518d%2Foptimum_six_on_dirt_sar_mix_all.png?generation=1667445015627506&alt=media)\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='58' size=\"+3\">Spohisticated Speed Time Curve of Top 3 Jockey with Optimum Path</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fd88278d7f26f6a25682f0b7381243a34%2Fjoc_with_optimum_reg.png?generation=1667501698321902&alt=media)\n\nThe above visualization clearly demonstrates that a **curve line that is closer to the optimum curve line will result in a winning position** in the race. For example, the speed time curve for **Joel Rosario follows the optimum path**, while the speed time curve for **Javier** and **Manuel** initially **shows Javier in the lead at the turn-in point** but **Manuel overtook him after taking a wider turn on the curve**, but again, if we look at the exit point curvature, **Javier regains the lead**.\n\n**However**, though it can be clearly seen in visualization there are **multiple factor are playing their role**. First, **is Manuel Horse Older than Javier Horse? Second, is Javier a Good Jockey compare to Manuel and vice vera? Third, is the trainer and owner are good in multiple scenerio for each individaul horse and jockey?** and much more other scenerios. So it's hard to say with this type of data provided. However, I have **performed** an **statical test to prove it** temporarily and will discuss it in later section.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='59' size=\"+3\">Win and Place Comparision with Optimum Path</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F642a2439a9f259ee7acf2f1b59c73f3d%2Ffinal_joel_jaiver.gif?generation=1667443978136544&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fc4294cbe31ac1c36f261b5eb6f5f23b4%2FJoel_Rosario_vs_Javier_Castellano.png?generation=1667447340748107&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fb21438c6859fd976aa995e18ca60e4d2%2Fjr_jv_reg.png?generation=1667501714088275&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fd1cc7e1770fb1894ab886e3c5c9b09f9%2Fjr_jc_acc_track.png?generation=1667450486360176&alt=media)\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='60' size=\"+3\">Win and Show Comparision with Optimum Path</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F897efef643a177be44fe54a8d0010e06%2Ffinal_joel_manuel.gif?generation=1667443987547595&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F65c443c6eba68020eba009e7b5b214d1%2FJoel_Rosario_vs_Manuel_Franco.png?generation=1667449364501438&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fbbd65ba6a44ef9998eabab4d316c4bf4%2Fjr_mf_reg.png?generation=1667501729513474&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F3ee3fbc9b5179e8fed41ecd661326971%2Fjr_mf_acc_track.png?generation=1667450502037929&alt=media)\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='61' size=\"+3\">Show and Place Comparision with Optimum Path</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F3958b1fbe26a3f052b0c4b75516816cc%2Ffinal_jaiver_manuel.gif?generation=1667443961081945&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F65b40e51c32a1c9a431f76999d692c08%2FJavier_Castellano_vs_Manuel_Franco.png?generation=1667449753750217&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F49817c57d307987ec167506936827706%2Fjv_mf_reg.png?generation=1667501746569029&alt=media)\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fd29c5dd844c20b3997977c27aef147df%2Fjc_mf_acc_track.png?generation=1667450471187808&alt=media)\n\n\n# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '62'>8 |</b> Statical Testing</p></div>\n\nWhat is the purpose of statical testing, first and foremost? As ealier we analyzed various scenario that typically happens during the race and **we took median co-ordinates** of the winning jockey and named that path as \"**Optimum Path**\". Now lets prove that the Optimum Path is better than Current path by asking bellow question.\n\n* **To determine whether there is a difference between a jockey's current path and an optimal path?**\n* **By taking an optimum path will help the Jockey to win race?**\n\nThis Kind of Questions can be solved with **t-test two related sample test**\n\nFirst we will **extract** the **required data** shown below:\n\n```python\n\n# Optimum Coordinates\ndf_opt = t_test_stat[(t_test_stat['is_opt'] == 1)][\n    [\"Speed (Mph)\",\"Optimal Speed (Mph)\",\"Acceleration\",\"Optimal Acceleration\",\"is_opt\"]\n]\n\n# Not Optimum Coordinate\ndf_not_opt = t_test_stat[(t_test_stat['is_opt'] == 0)][\n    [\"Speed (Mph)\",\"Optimal Speed (Mph)\",\"Acceleration\",\"Optimal Acceleration\",\"is_opt\"]\n]\n\n```\n\nNow let's define the **Null Hypothesis** and **Alternative Hypothesis** for **Speed** and **Acceleration**\n\n<h3><b><span style='color:#EE2737FF;'><font id='63'>Speed</font></span></b></h3>\n\n* Jockey who were **Not on an Optimum Speed** w.r.t to track_us_index\n\n    - **Null Hypothesis**: among jockeys who wasn't on an optimum speed, the speed of the current path is the same as the optimum path.\n\n    - **Alternative Hypothesis**: among jockeys who was on an optimum speed, the speed of the optimum path is better than the current path.\n\n* Jockey who were **on an Optimum Speed** w.r.t to track_us_index\n\n    * **Null Hypothesis**: the average speed before and after taking an optimum path is the same.\n\n    * **Alternative Hypothesis**: the average speed after taking an optimum path (Optimum Speed (Mph)) is better than before (Speed (Mph)).\n\n* Notice that with the way we formulate the alternative hypothesis, we’re conducting a **left-sided hypothesis**.\n\n\n```python\n\ntest_statistic, p_value = ttest_rel(df_not_opt['Speed (Mph)'], df_not_opt['Optimal Speed (Mph)'],alternative='less')\n\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fc05c1b02dde9bc97556161f62ae75a06%2FScreen%20Shot%202022-11-09%20at%2012.48.11%20AM.png?generation=1667976695595923&alt=media)\n\nAs we can see, the **p-Value is very small**, which means that we can say that the **jockeys path after taking an optimum path is indeed better than current path**. At a significance level of 0.05, **we reject the null hypothesis in favor of the alternative hypothesis**.\n\n\n```python\n\ntest_statistic, p_value = ttest_rel(df_opt['Speed (Mph)'], df_opt['Optimal Speed (Mph)'],alternative='less')\n\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F1005855dae4ebae90e1890a8ccce6012%2FScreen%20Shot%202022-11-09%20at%2012.48.20%20AM.png?generation=1667976755017696&alt=media)\n\n\n<h3><b><span style='color:#EE2737FF;'><font id='64'>Acceleration</font></span></b></h3>\n\n* Jockey who were **Not on an Optimal Acceleration** w.r.t to track_us_index\n\n    - **Null Hypothesis**: among jockeys who didn’t applied an optimal acceleration, the acceleration applied on the current path is the same of the optimum path.\n\n    - **Alternative Hypothesis**: among jockeys who didn't applied an optimal acceleration, the acceleration applied on the optimum path is better than the current path.\n\n* Jockey who were on an **Optimum Acceleration** w.r.t to track_us_index\n\n    * **Null Hypothesis**: the average acceleration applied before and after taking an optimum path is the same.\n\n    * **Alternative Hypothesis**: the average acceleration on an optimum path (Optimal Acceleration) is better than that of current path (Acceleration).\n\n* Notice that with the way we formulate the alternative hypothesis, we’re conducting a **left-sided hypothesis**.\n\n\n```python\n\ntest_statistic, p_value = ttest_rel(df_not_opt['Acceleration'], df_not_opt['Optimal Acceleration'],alternative='less')\n\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F2a2c8eacddd3ae9c41a3262ee3605124%2FScreen%20Shot%202022-11-09%20at%2012.57.16%20AM.png?generation=1667977663223196&alt=media)\n\n\n```python\n\ntest_statistic, p_value = ttest_rel(df_opt['Acceleration'], df_opt['Optimal Acceleration'],alternative='less')\n\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F945ce753b728ebb69cf3744c204e4a4d%2FScreen%20Shot%202022-11-09%20at%2012.59.30%20AM.png?generation=1667977354409268&alt=media)\n\nHence, I can say that **Optimum Speed is better than current speed** and also I can say that If I match the winning Optimum Speed I can win the race.\n\n# <div style=\"color:#EE2737FF;display:fill;border-radius:5px;background-color:#28334AFF;letter-spacing:0.1px;overflow:hidden\"><p style=\"padding:10px;color:#EE2737FF;overflow:hidden;margin:0;font-size:100%\"><b id= '65'>9 |</b> Machine Learning Model</p></div>\n\nBefore delving into machine learning, I would say that this **competition's data is more of a math problem**, and **machine learning** is a **math function** that **performs a lot math calculations**. People also **prefer** to create their **own models in large industries rather than using 3rd party libraries** like **sklearn** or **AutoML tools**, etc. I have observed that many of the competitors have applied a lot of difficult theory, peer-reviewed research, etc. and they have done really decent job. **However, lets make it more simple for non-techinal as well as technical person**.\n\nSo as we have proved that Optimum Path is better than the Current Path we can now evalaute and calculate the **result** of the **actual** and the **optimum speed** where **Actual Speed** is the **predicted value** and **Optimum Speed** is the **ground truth label**. Bellow is the **Evalution Metric Summary** for each jockey for that particular race.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='66' size=\"+3\">Model Evaluation Metric</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F9bbf5bab0118a4ef7eb2cdc58dea3b4d%2FEvalution.png?generation=1667501332826574&alt=media)\n\nAs we had previously visualized, that the **accuracy is improved by being closer to the optimum curve line**. We also demonstrated that the **optimum path speed is preferable than the current speed**, and this is also evident in the evaluation metric summary. But, we can also see one more interesting scenerio that **though Jose Ortiz** followed the **ideal path according to our evalution metric**, why did he **finished in sixth place?** Let's examine it and lets find way to overcome this problem.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F46cfca95e135f075e52d2b9e93554e2c%2Fjr_jo_reg.png?generation=1667986865283589&alt=media)\n\nHere we can clearly see that **Jose Ortiz also follows** the same **optimum path coordinates** however his **speed was less compare to Joel Rosario**. So sometimes this **kind of situation arries** and **due to that it might predict wrong result**. So how can we overcome this situation? Answer is very simple we need to come with **our own model** instead of using **Sklearn** or **third party library** and we need to **make** some **data inspired decisions** and by **levaraging** the **use of external dataset** which include all of the crucial race varaibles that are not currently present in provided dataset. Such as variety of variables, including the **horse's age**, the **jockey's expertise**, the **trainers** and **owners**, and many more **other variables**, which may have a **significant impact** on final result according to me. \n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='67' size=\"+3\">Math Model to Forecast Jockeys Probable Place</font></span></b></h3></center>\n\nAs we have seen that all above visualizations there were **some factors** that are **causing our model to predict wrong** also the provided dataset does not have all the main crucial data that play an important role to predict the final position of jockey. So, I decided to make my own dataset that is available at [Equibase](https://www.equibase.com/) website at not cost and then by creating a Mathemetical Equation to predict the probability for each individual shown bellow.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F69e0f3a8728ab93bce1fcc1c2c763b51%2FMy_Math.png?generation=1668070767962674&alt=media)\n\nNow, lets breakdown our math model to Predict the Jockey / Horse Chance of Winning in simple 3 Steps and finding the solid wager.\n\n* **Step 1**: Find out the Percentage Chance that Racebook thinks each Horse will by applying Implied Probability.\n* **Step 2**: Fetch your Custom Ratings in scale of 10 for each Name Entity(Jockey, Trainer, Owner, Weather, Horse Age etc).\n* **Step 3**: Assign the value for each Name Entity to our Math Model to get final results.\n\n<center><h3><b><span style='color:rgb(0, 103, 71);'><font id='68' size=\"+3\">Real-time Race Predictions</font></span></b></h3></center>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F9e4fad5e63122dff9aa5af28d1b03cf0%2Ffinal_25.gif?generation=1669510741094698&alt=media)\n\n**Note**: *Data being used to predict the result doesn't uses any of the competition data by any means*\n\n<h3 style=\"color:#EE2737FF\">Prediction Result of Nov 25 Race-1</h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F46fc8477fe5f9bb99d764e4844b548bf%2Ffinal_25.png?generation=1669511065550898&alt=media)\n\n**Note**: *Data being used to predict the result doesn't uses any of the competition data by any means*\n\n<h3 style=\"color:#EE2737FF\">Actual Result of Nov 25 Race-1</h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Ff0d46bce68227cf3afae4b32459453bd%2FActual_25.png?generation=1669511362797462&alt=media)\n\n<h3 style=\"color:#EE2737FF\">Key Findings of 25 Nov Race - 1</h3>\n\n1. Carmouche Kendrick is predicted by the betting odds to win the race with a 33.33% margin of victory. However, it is very risky to bet, according to the mathematical model.\n\n2. The betting odds anticipated Jose Gomez to win by 5.56%. But he really finished at third, and the model provided us a calculated risk to bet on him in Win, Show, or Place.\n\n3. Irad Ortiz won, as predicted by our model, but it was not a wise bet to increase profits. Moreover, we can bet on the side of safety.\n\n4. Last but not least, Herman's calculated risk was 12.92%. Normally, we wager on Win, Place, and Show, and in this situation, it doesn't matter.\n\nAlso, there are some limitations here. Junior Alvarado, for instance, came at second place, and I think we could improve things if we had more data on the crucial racing parameters. Similar to this, I foresaw Race 1 of November 26 and got positive outcomes with Morning Line Odds.\n\n<h3 style=\"color:#EE2737FF\">Prediction Result of Nov 26 Race-1</h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F95d4c0932274ba0667e99e8a0ddc58e1%2Ffinal_26.png?generation=1669521052525195&alt=media)\n\n**Note**: *Data being used to predict the result doesn't uses any of the competition data by any means*\n\n<h3 style=\"color:#EE2737FF\">Actual Result of Nov 26 Race-1</h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F89f05750184d478f643d5f5c0534c146%2FActual_26.png?generation=1669521342999843&alt=media)\n\nHere too, we may witness the fruitful outcomes.\n\n<h3 style=\"color:#EE2737FF\">Real-time  Prediction of Nov 27 Race-1</h3>\n\n![](https://i.postimg.cc/fLBXLVHb/final-27.gif)\n\n**Note**: *Data used to predict the result doesn't use any of the competition data by any means*\n\n<h3 style=\"color:#EE2737FF\">Prediction Result of Nov 27 Race-1</h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2Fdb3041cd19d9a793c187884d057ccb2b%2Ffinal_27.png?generation=1669603448695101&alt=media)\n\n**Note**: *Data used to predict the result doesn't use any of the competition data by any means*\n\n <h3 style=\"color:#EE2737FF\">Actual Result of Nov 27 Race-1</h3>\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F8412510%2F43fd1be4afdc1998d69665829c6c3b75%2FActual_27.png?generation=1669603567952745&alt=media)\n\n<h3 style=\"color:#EE2737FF\">Key Findings Summary</h3>\n\nFor **3 consecutive days**, the mathematical model **gave positive calculated risks**  in real-time. Also, in the future, I will come up with a little advanced model but with simple logic that anyone can understand. However, I would value your opinion on this discussion. Thank you.\n\n<h2 style=\"color:rgb(0, 103, 71);\"><b id=\"007\">Part 7: Conclusions</b></h2>\n\n**In conclusion**, as we all know there could be multiple path in an given track but, **What could be the best winning optimum path?** and with respect to that **we used simple brain** and **found one best optimum path** which **proves** the **statical significance priciple**. Moreover, we also **found one flaw** in that what if we take same path but with less speed which had a big blunder. So in order to that we created a **custom novel math function** with a **personal dataset** that can take multiple parameters related to race and predict it's outcome. However, we **need more data to make more inspired decisions** such as **Which gene the horse belong?**, **Who is the breeder? Father? Mother?** etc. \n\n\n<h2 style=\"color:rgb(0, 103, 71);\"><b id=\"008\">Contact Details</b></h2>\n\n<table>\n    <tr style=\"border:2px solid black;\">\n      <td><b>Contact</b></td>\n      <td style=\"border:2px solid black;\" rowspan=\"4\">\n        <img alt=\"Photo\" src=\"https://i.postimg.cc/d3bzYKXz/KMT.png\" width=200 height=200/>\n      </td>\n    </tr>\n    <tr style=\"border:2px solid black;\">\n      <td>\n        <ul>\n          <li><a href=\"https://www.linkedin.com/in/kush-trivedi/\">LinkedIn</a></li>\n          <li><a href=\"https://www.kaggle.com/kushtrivedi14728\">Kaggle</a></li>\n        </ul>\n      </td>\n    </tr>\n    <tr style=\"border:2px solid black;\"><td><b>Derby Notebooks</b></td></tr>\n    <tr style=\"border:2px solid black;\">\n      <td>\n        <ul>\n          <li><a href=\"https://www.kaggle.com/code/kushtrivedi14728/key-to-win-the-bet-on-horses-with-math-model\">Summarized Notebook</a></li>\n          <li><a href=\"https://www.kaggle.com/code/kushtrivedi14728/advance-eda-with-ml-big-data-derby\">Detailed Notebook</a></li>\n          <li>Realtime Predictions</li>\n        </ul>\n      </td>\n    </tr>\n</table>","metadata":{}}]}