All Projects → Torvaney → fpl-optimiser

Torvaney / fpl-optimiser

Licence: other
Optimise FPL squads

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to fpl-optimiser

rust-lp-modeler
Lp modeler written in Rust
Stars: ✭ 75 (+50%)
Mutual labels:  linear-programming
flipy
A Python linear programming interface library
Stars: ✭ 23 (-54%)
Mutual labels:  linear-programming
fplscrapR
This package enables those interested in Fantasy Premier League to perform detailed data analysis of the game, using the FPL's JSON API. The fplscrapR functions help R users collect and parse data from the Official Fantasy Premier League website.
Stars: ✭ 64 (+28%)
Mutual labels:  fantasy-premier-league
good lp
Linear Programming for Rust, with an user-friendly API. This crate allows modeling LP problems, and let's you solve them with various solvers.
Stars: ✭ 77 (+54%)
Mutual labels:  linear-programming
Machine-Learning
🌎 I created this repository for educational purposes. It will host a number of projects as part of the process .
Stars: ✭ 38 (-24%)
Mutual labels:  linear-programming
minizinc-python
Access to all MiniZinc functionality directly from Python
Stars: ✭ 92 (+84%)
Mutual labels:  linear-programming
L1-optimal-paths-Stabilization
Video Stabilization with the L1 optimal camera paths technique.
Stars: ✭ 33 (-34%)
Mutual labels:  linear-programming
linearprogramming
Code for the Modeling and Solving Linear Programming with R book
Stars: ✭ 38 (-24%)
Mutual labels:  linear-programming
EKR-SIMPLEX-PROBLEM-CALCULATOR
simplex problem calculator
Stars: ✭ 13 (-74%)
Mutual labels:  linear-programming
fantasy-premier-league
Fantasy Premier League Stats, Visualizations & Analysis. ⚽ 📊 📈
Stars: ✭ 31 (-38%)
Mutual labels:  fantasy-premier-league
gibbous
Convex optimization for java and scala, built on Apache Commons Math
Stars: ✭ 17 (-66%)
Mutual labels:  linear-programming
SimplexSolver
An easy-to-use Simplex solver class for linear programming.
Stars: ✭ 18 (-64%)
Mutual labels:  linear-programming
Linear-Algebra-and-Its-Applications-notes
《线性代数及其应用》笔记
Stars: ✭ 196 (+292%)
Mutual labels:  linear-programming
rcbc
COIN-OR branch and cut (CBC) bindings for R
Stars: ✭ 16 (-68%)
Mutual labels:  linear-programming
emhass
emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.
Stars: ✭ 54 (+8%)
Mutual labels:  linear-programming
portfolio allocation js
A JavaScript library to allocate and optimize financial portfolios.
Stars: ✭ 145 (+190%)
Mutual labels:  linear-programming
antaresViz
ANTARES Visualizations
Stars: ✭ 19 (-62%)
Mutual labels:  linear-programming
rmpk
Mixed Integer Linear and Quadratic Programming in R
Stars: ✭ 37 (-26%)
Mutual labels:  linear-programming
minilp
A pure Rust linear programming solver
Stars: ✭ 61 (+22%)
Mutual labels:  linear-programming
blt
Lattice-based integer linear programming solver
Stars: ✭ 60 (+20%)
Mutual labels:  linear-programming

FPL optimiser

Use linear programming to find the optimal fantasy football (soccer) squad.

This is not my idea and was originally (to my knowledge) by Martin Eastwood. You can find his blog post here: http://www.pena.lt/y/2014/07/24/mathematically-optimising-fantasy-football-teams/

The code was written on python 3.5.

How to use it

This repo contains two main modules. fetch_fpl_history downloads the data from the fpl website. optimise allows you to find the optimal squad for a given season.

Usage is pretty simple. Just run the following two commands from the command line:

> python fetch_fpl_history.py
> python optimise.py

This will output an optimised squad, like the example below:

Position               Name  Cost  Points
Goalkeeper         Tom Heaton   5.0   149.0
Goalkeeper     Fraser Forster   5.0   134.0
  Defender    Charlie Daniels   5.0   134.0
  Defender  César Azpilicueta   6.5   170.0
  Defender        Gary Cahill   6.5   178.0
  Defender      Marcos Alonso   7.0   177.0
  Defender     Gareth McAuley   5.0   131.0
Midfielder          Joe Allen   5.5   118.0
Midfielder  Christian Eriksen   9.5   218.0
Midfielder      Bamidele Alli   9.5   225.0
Midfielder     Etienne Capoue   5.5   131.0
Midfielder   Robert Snodgrass   6.0   133.0
   Forward        Joshua King   7.5   178.0
   Forward      Jermain Defoe   8.0   166.0
   Forward    Roberto Firmino   8.5   180.0

Total cost:     100.0
Total points:   2422.0
Formation:      2-5-5-3

Notes

Some notes on each of the modules

fetch_fpl_history

fetch_fpl_history fetches the data from the FPL website and saves it to data/fpl_history.csv.

This file includes a call to time.sleep so that we don't overload the FPL website's servers. Please bear this in mind and when scraping.

optimise

Once you have downloaded the data, you can run python optimise.py from the command line to find the optimal squad.

You can optionally change the optimiser's constraints with some command line arguments. For instance, if you wanted to run the optimiser with a different budget to the default £100, you can run python optimise.py --budget 105.

Another option is to supply a different formation to the default 2-5-5-3. For example if you wanted to optimise the first XI players (replacing the remaining squad places with £4.0 players), you could try python optimise.py --formation 1-4-4-2 or python optimise.py --formation 1-3-4-3.

Or perhaps you've already decided which star striker (£10) you'll put in your team and want to optimise the rest of the squad python optimise.py --formation 2-5-5-2 --budget 90

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].