Skip to main content

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

Project description

GeneticPy

Build Status PyPI version codecov

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)}

best_params, loss = geneticpy.optimize(loss_function, param_space, size=200, generation_count=500, verbose=False)

PyPi Project

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

Contact

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geneticpy-0.1.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

geneticpy-0.1.1-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page