Skip to content
GeneticPy is an optimizer that uses a genetic algorithm to quickly search through custom parameter spaces for optimal solutions.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
geneticpy
tests
.gitignore
.travis.yml
LICENSE
README.md
codecov.yml
setup.cfg
setup.py

README.md

GeneticPy

Build Status codecov PyPI version PyPI pyversions Downloads

GeneticPy is an optimizer that uses a genetic algorithm to quickly search through custom parameter spaces for optimal solutions.

Installation

GeneticPy requires Python 3.4+

pip install geneticpy

Example Usage:

A brief example to get you started is included below:

def loss_function(params):
  if params['type'] == 'add':
    return params['x'] + params['y']
  elif params['type'] == 'multiply':
    return params['x'] * params['y']

param_space = {'type': geneticpy.ChoiceDistribution(choice_list=['add', 'multiply']),
               'x': geneticpy.UniformDistribution(low=5, high=10, q=1),
               'y': geneticpy.GaussianDistribution(mean=0, standard_deviation=1)}

results = geneticpy.optimize(loss_function, param_space, size=200, generation_count=500, verbose=True)
best_params = results['top_params']
loss = results['top_score']
total_time = results['total_time']

PyPi Project

https://pypi.org/project/geneticpy/

Contact

Please feel free to email me at brandonschabell@gmail.com with any questions or feedback.

You can’t perform that action at this time.