Tuesday, October 20, 2015

DFS and Optimization: Simple Optimization

Now that we have data, let's actually get into the point of having this data: choosing what players to play each day. For our first go, we're going to take a simple approach. We'll start out with just pitchers and maximizing over just one metric, game score. This will allow us to get a refresher in how to run an optimization problem in R and create a set of code that we will be able build out in the future.

First step is merging the datasets that have the two data points we need. Using this dataset, we'll create an empty Integer Program. Our decision variables will be binary variables representing if we will choose that player or not. The IP will have two constraints:

  1. We must select 2 pitchers
  2. The total salary used must be below a threshold
Using lpSolve, we can construct the problem and solve it. The results are interesting as it's easy to see what players were optimal selection. That being said, this is just a start.


No comments:

Post a Comment