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 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-hypernode.com/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-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

geneticpy-1.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file geneticpy-1.0.1.tar.gz.

File metadata

  • Download URL: geneticpy-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for geneticpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e361a6e5e0fa7751fed30ca90b964cc18be35bbed71e319ff16370aaf91b1d19
MD5 3b90c663118db35ed48fbb3d4236587e
BLAKE2b-256 5c43e33216b5256157bb1f8ce227db1e7581d04caf4889925b0757a575b4df03

See more details on using hashes here.

File details

Details for the file geneticpy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: geneticpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for geneticpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c30a21abb1e04f9122be8ca045b572ef7ab204a71325823176285d8bebdde4ea
MD5 ddb84a1ebb16ca989a6a0583c4c22001
BLAKE2b-256 82b43a86c7b8f81d42ad0d00a60bab93221c15f39f6d4db36cff7daa46798480

See more details on using hashes here.

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