Coder Social home page Coder Social logo

mattbeth / nba-optimize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jackschultz/nba-optimize

0.0 1.0 0.0 70 KB

Code that show how to optimize a DFS NBA lineup, which is a version of a knapsack problem

Python 20.97% Jupyter Notebook 79.03%

nba-optimize's Introduction

nba-optimize

Code that show how to optimize a Daily Fantasy Sports (DFS) NBA lineup, which is a version of a knapsack problem.

Assiciated blog post where I talk about the code.

Three files included, basic_optimize.py, brisk_optimize.py, and fast_optimize.py each show different ways to perform the optimization.

I included csv data files for us to use. I used other code to get the data from nba.com and the info from FanDuel csv files that list the players and their salaries.

I'm assuming you'll have a virtualenv running python3. If so, run the following:

(nbaoptimize) $ pip install -r requirements
  .....
(nbaoptimize) $ python fast_optimize.py 2018-10-24

where the second argument is the data file to use.

Three files are also included to show examples of how the three solutions were done using Jupyter notebooks: example_basic_optimize.ipynb, example_brisk_optimize.ipynb, and example_fast_optimize.ipynb.

To run the Jupyter notebooks, instead of looking at the files here, run

$ jupyter notebook

which opens a new tab in browser where you can click the notebook files and run them yourself.

nba-optimize's People

Contributors

jackschultz avatar

Watchers

James Cloos 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.