Git Product home page Git Product logo

custom_war's Introduction

Custom WAR

This is my work in progress WAR calculator. It will be my own custom implementation of WAR. I'm looking to make it so pitcher quality of contact (xBA, xSLG) is considered to give contact pitchers credit for what they do, and that's all I know already (lol). This will probably take me a while, so I'm taking it one step at a time.

Credits and copyrights

Some data downloaded comes from retrosheet. This means that, as of now, you can only calculate WAR for completed years after they're added to retrosheet. This is their data usage notice:

     The information used here was obtained free of
     charge from and is copyrighted by Retrosheet.  Interested
     parties may contact Retrosheet at "www.retrosheet.org".

There's also Statcast data that you must download. I use PyBaseball to download it.

Tutorial

There are different keyword arguments for all of the Python files (mostly just to set the start and end years). Just use the --help keyword argument after the python file command to see the syntax. For the year arguments, never use a value below 2015 because this relies on statcast data. Why I haven't restricted it? I don't know, but I haven't.

First run this in order to create all the necessary folders:

$ ./init_project.sh

Then, run these commands to download the retrosheet data:

$ python3 download.py
$ ./retrosheet_to_csv.sh

Also, run this to download statcast data:

$ python3 statcast_pitch_download.py
$ python3 combine_csv.py

To calculate the cumulative and average stats and store it, run:

$ python3 calc_averages.py

custom_war's People

Contributors

jso8910 avatar

Watchers

 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.