Learn R Programming

openWAR (version 0.2.2.9001)

getModels: getModels

Description

Retrieve various models trained on GameDayPlays data

Usage

getModels(data, ...)

# S3 method for GameDayPlays getModels(data, ...)

Arguments

data

a GameDayPlays dataset

...

currently ignored

Value

A list of model objects

Details

This function will retrieve various models based on the MLBAM data set and the openWAR framework. Currently this only returns the Run Expectancy Model.

Examples

Run this code
# NOT RUN {
data(May)
re.mod = getModels(May, type = 'run-expectancy')

# Generate the Run Expectancy Matrix
states = expand.grid(startCode = 0:7, startOuts = 0:2)
matrix(predict(re.mod[["run-expectancy"]], newdata=states), ncol=3)
# }

Run the code above in your browser using DataLab