Skip to content

Instantly share code, notes, and snippets.

View treviesweets's full-sized avatar

Trevor Sweetnam treviesweets

View GitHub Profile
@treviesweets
treviesweets / gist:dfde205260c75d10f16b
Created July 18, 2014 13:08
Line Fitting With Pyevolve
### finding the best fit line for data with a random error ###
#
# a simplification of the example given at http://acodersmusings.blogspot.co.uk/2009/07/curve-fitting-with-pyevolve.html
#
# using a genetic algorithm to infer the parameters of a model - the simplest form possible, a straight line fit.
#
from pyevolve import G1DList, GSimpleGA, Selectors, Scaling, DBAdapters
import numpy