R code for Data Analytics portion of MLB Pitcher's Friend
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
plots
.Rapp.history
.gitignore
00-AnalyticsAntMaster.R
00-WIP-Bat.R
00-WIP2-Bat.R
01-FormulateURL.R
01-ObtainData-API.R
01-ObtainData.R
02-GenerateImagesBKUP-20170830.R
02-GenerateImagesBrewers.R
02-GenerateImagesTmp-BKP01.R
02-GenerateImagesTmp.R
02-TidyData.R
03-GenerateImages.R
201810-Testing.R
21-MachineLearning.R
Dockerfile
Dockerfile.new
MLB-TargetedHitters.txt
Master01.R
PkgCheckpoint.R
R-3.4.3.pkg
README.md
hitters.rds
mlb-analytics-ant.Rproj
mlb-analytics-engine.R
pitchesJoin.csv
sql_test.R

README.md

MLB Pitchers Friend

"Helping hitters become batters...and then sitting them back down"

Full Project Description

MLB Analytics Ant

The MLB Analytics Ant is the Data Analytics component of the MLB Pitchers Friend, developed by the Fire Ants.

The Analytics-Ant receives a single variable, Major League Baseball Identification Number (mlbID), from the Queen-Ant control station. The Analytics Ant then connects to the API-Ant to query for pitches on specific batters that are maintained in the Mongo database.

Application Workflow

These R subroutines will run within the same container.

###01-ObtainData.R

  1. Receive 1 variable (mlbID) from the docker run command used to activate the container
  2. Query the MLB-API-Ant for information pertaining to that specific mlbID
  3. Generate aggregate data frame with all pitches and atbat events for the referenced hitter...

###02-TidyData-R

  1. Apply data transformations to the aggregate data frame

    • Apply Hitter Value per-pitch scoring algorithms (QuantScore & QualScore) to pitches
    • Transform similar pitch types
  2. Subset the transformed aggregate data frame for specific batter

###03-GenerateImages.R

  1. Generate a traditional Hitter Heat Map for season to date information.
  2. Generate a Hitter Value Heat Map.
  3. Storage these images in Virtustream Storage Cloud.

####04-Regressison Analysis.R (To Be Developed)

  1. Fit a prediction model to the subset hitter data frame
  2. Create confidence intervals and recommendations on how to defeat hitters.