Jump to content

Baseball statistics website created by yours truly


Recommended Posts

24 minutes ago, Sanfran327 said:

I was expecting to see a larytt style post, tbh. Lol 

are you running sql queries over a stat database? Or am I dating myself? Either way, cool concept. This group will help you hone it for sure. 

Yeah the final product uses SQL backend. (SQLite at the moment) .  The idea is the user wouldn't have to mess with that, although some concepts such as grouping and aggregations map nearly 1-1 with SQL concepts, you just click/select what you want, and with some experimenting it should become apparent what was going on (I hope)

Still more work to be done on the team stats, I could add more filter types, allow, custom stats, etc. but right now I find working on the event files more interesting.  Like I would want to see all at-bats Babe Ruth had vs. Walter Johnson, something like that.

There are resources like Chadwick and Boxball,  might be faster to get certain things but I thought it would be fun to process the raw data myself, as well as have max flexibility to extract what I want

  • Upvote 2
Link to comment
Share on other sites

Here's an interesting case I came across

 

Quote

home=  PIT  away= NY1  date= 1912-08-23
...
applyPlay T2 NY1 0 PIT 0 0 outs
NY1 merkf101 at bat PIT otoom101  pitching
onBase: 1: murrr103 2:          3:
play=  K
strikeout
runner on 1  does not advance
play runs= 0 outs=  1
applyPlay T2 NY1 0 PIT 0 1 outs
NY1 herzb101 at bat PIT otoom101  pitching
onBase: 1: murrr103 2:          3:
play=  S7.1-3
single
runner on 1 advanced to 3
basesAdv= {1}
play runs= 0 outs=  0
applyPlay T2 NY1 0 PIT 0 1 outs
NY1 meyec101 at bat PIT otoom101  pitching
onBase: 1: herzb101 2:          3: murrr103
play=  FC6.3-H;1X2(6E4);B-1
fielders choice
runner on 1 is out
runner on 3  ( murrr103 ) scored
runner on 1 out at 2
runner on B advanced to 1
basesAdv= {1, 3}
play runs= 1 outs=  1
applyPlay T2 NY1 1 PIT 0 2 outs
NY1 fleta101 at bat PIT otoom101  pitching
onBase: 1: meyec101 2:          3:
play=  64(1)/FO.2-3
force out
runner on 1 is out
ERROR: Could not find runner on base 2


It would seem the base runner that had advanced to second on the prior play not out despite that play showing "1X2", it was cancelled by 6E4. Anyone want to weight in?

Link to comment
Share on other sites

Well the answer seems to be the "X" is ambitious when there is an error on the play, because I have found examples where it does mean the runner is out, by double checking baseball reference.  Wow, what a mess that old data is...  I have been able to  code up a workaround where I assume one way, and iif I get an error, I replay the inning assume the opposite.  But I'm still failing to parse ~50% of the games, and  this is without even verifying all the stats match up with the game logs, although I did a couple and they seemed correct.

If I can get over this hump I have a bunch of nice tables with all types of situational data, which would pretty cool to query. 
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...