vsharm / markovbaseball-webapp

Markovbaseball.pw Webapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

This is an application designed to demonstrate the application of markov chains to baseball. The site parses the CCCBA or the California Community College Baseball league Statistics page nightly, using a python library called Scrapy. A cron job is set up to run nightly to grab the most recent data to display on the site.

The webapp is built using Django. The webserver is gunicorn with nginx to serve the static assets.

All of the graphs on the home page were created using the D3 javascript library, and all the graphs for the team pages were created using the chart.js library.

How to Run

Scrapy

All of the scrapy files are located in the directory markov_baseball.

To run scrapy cd into markov_baseball and run scrapy crawl ccba -o ccba.json -t json. To sort that data run python sort.py.

Django

All of the Django Files are located in the directory markovbaseball.

To run the Django development server cd into markovbaseball and run python manage.py runserver 0.0.0.0:[port#]

Math

The two main mathematical files are markov_calculator.py which does the raw markov calculations to find and analysis.py which does all of the analysis based on the run numbers generated by the markov chain.

Thanks

Jimmy Gardner - The baseball player and peer who was a key to the mathematics of this project.

Subha Rengarajan - Assisted with the understanding of much of the math in this project.

Abhinav Kalakuntla - For helping me get this website live

Yunxiao Liu - The graduate student who taught me markov chains in depth 1:1 in the UCSD GULP Program

About

Markovbaseball.pw Webapp


Languages

Language:HTML 45.9%Language:JavaScript 35.3%Language:Python 17.9%Language:CSS 0.7%Language:Shell 0.1%