GithubHelp home page GithubHelp logo

jay-latta-01 / fanduelbaseballgeneticalgorithm Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 34 KB

A Python repo for a genetic algorithm I wrote to generate FanDuel fantasy baseball lineups optimized for expected fantasy points.

License: MIT License

Python 100.00%
fanduel fantasy-baseball genetic-algorithm integer-linear-programming integer-programming optimization

fanduelbaseballgeneticalgorithm's Introduction

FanDuel Baseball Genetic Algorithm

This repo centers around a genetic algorithm used to generate FanDuel fantasy baseball lineups optimized for expected player points. It contains the algorithm, a test file to run it with different parameters, a Pyomo mixed-integer programming model to find the optimal expected points for a given set of players, and processed player data files containing player names, positions, costs, and average fantasy points.

Installation

Clone the repo into a Python virtual environment and install required packages using pip

pip install requirements.txt

Getting Started

Navigate to the test file (runGA.py) and change the following parameters as you see fit:

popSize = <YOUR POPULATION SIZE>
bitwiseMut = <YOUR MUTATION RATE>
nImp = <YOUR NUMBER OF ITERATIONS WITHOUT IMPROVEMENT>
input_file = <YOUR INPUT FILE>
output_file = <YOUR OUTPUT FILE (optional)>

Pre-processed data for testing can be found in the FDPlayerDataProcessed folder. If you are utilizing your own data files, ensure they are formatted and processed the same as those in FDPlayerDataProcessed.

Then, add additional code to utilize or analyze your outputs if needed and run the file.

Analyzing Results

The results of running the algorithm with the parameters you specify can be analyzed by examining the execution time (included in the function outputs) and comparing the "fitness" of the best found solution to the true optimal obtained by solving the mathematical model, which is included in mathModel.py. To execute this file and get the optimal total value for a given set of players, you must install the glpk solver to your machine.

License

This repository is licensed under the MIT License

fanduelbaseballgeneticalgorithm's People

Contributors

jay-latta-01 avatar

Watchers

 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.