Giter Club home page Giter Club logo

off_to_the_races's Introduction

Off_to_the_Races

Build Your Race! ๐Ÿด

Overview

For this project, we wanted to create a model-based dashboard that enables users to make educated selections in order for "their horse" to finish at the desired position. The dashboard shows visualizations of each variable that goes into the model. Those variables being: Jockey(and jockey weight), race track, track turf, track condition, race class, and race number. Once a selection is made for each variable and the user clicks "Submit", the selected variables' coefficients are sent to the model equation, the equation outputs the predicted placement, and a race chart is shown that ends with the user's horse at the predicted placement.

Sequence.01.mp4

Group Members

  • Georgia Myers
  • Jhernie Evangelista
  • Lija Hoffman
  • Sofia Ysita

Project Planning (Thanks Figma!)

Screenshot 2023-02-23 at 12 22 14 PM

Data Sources

Backend

Data Extraction

Data retrieved from S3 Bucket. Columns labeled appropriately and transformed into Pandas DataFrame. DataFrame filtered to include only columns and jockeys of interest, deleting duplicate data. Data one-hot encoded, creating a separate column containing dummy values 0 and 1 for for each variable with a string entry. Dependent variable (position at finish) removed from original DataFrame and entered as a separate DataFrame. X and y variables set using independent and dependent variable DataFrames, respectively. Various regression models (i.e., Ridge, Lasso, Multivariate Linear) trained and tested using a combination of scaled and unscaled independent variable data. Training and test scores computed for all regression models. Variable coefficients and y-intercepts calculated for Ridge and Linear regression models. Ultimately, it was determined that the Unscaled Multivariate Linear Regression Model had the greatest predictive accuracy and the associated coefficients and y-intercept were used in the model equation:

0.13409(race_number) - 0.02071(avg(weight_carried) + tack_id_coefficient + course_type_coefficient + track_condition_coefficient +     race_type_coefficient + jockey_coefficient + 6.353424818425532

Front-end

Javascript (Thanks ChatGPT!)

After having a trained model, we needed a front-end/ back-end interaction where inputs from user were taken in the front end and used in the model's equation and later in a race chart. Model Equation (model.js): For the model equation we decided to use Javascript. We asked ChatGPT how to create a form for a multivariate regression for users to input information that will update a trained model, and it responded with an easily modifiable starter code for both HTML and JS files and how they interact (see image below). The HTML contains a "form" with drop down user selection that then is imported to the JS file where the parameters are added to a function with the equation.

Screen.Recording.2023-02-22.at.8.58.23.PM.mov

Race Chart (barchart.js): For the race chart we used AMCharts that provide you with the documentation necessary to create a bar race chart. We created a function so the result from the model's equation gets inputted on the bar chart's final position. Through an if statement we made sure the chosen horse ended up on the position the model predicted.

HTML

The dashboard set-up of this project was done through the Bootstrap library (v5.3) as well as some plots embedded from Tableau and the racing chart from (racing library). The set of select menus all interact with the javascript file where the variables' coefficients are plugged in to the model's equation which sends the placement prediction back out to the frontend and triggers the racing chart. Carousels as well as static images are presented in order to give the user more information on the options they have for each select menu.

CSS

One styles sheet was used for this dashboard which coordinated the sizing and colors of the finer details for the final look of the page.

Dashboard + Tableau

Screenshot 2023-02-23 at 7 19 53 AM

Future Development

With more time:

  • Dynamic filtering that drives a change in jockey and course photos
  • Cleaner formatting
  • More Jockeys to be included in the model
  • More Visualizations (additional Jockey stats)

With more data/deeper dive:

  • Creating live betting functionality! ($$)
  • More model iterations (and explorations)

off_to_the_races's People

Contributors

jhernie avatar lijahoffman avatar gmyers95 avatar sofiaysita avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.