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.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: geneticpy-1.1.0.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.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for geneticpy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c9a6371073ab5d0ca34deda7ff7a7c2aa1a1495a408acfe1c17cfb3805b84831
MD5 f56f341983830699bfe4e71e1c6a6563
BLAKE2b-256 8072c89090c2ebdc05abdeb5095005ad8785f75fd49cc98cfb096391b8cbf68a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geneticpy-1.1.0-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.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for geneticpy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8081f91aa14d644cbcc8132d4ff05ef50d2b7be1ae7a18617c563a03a7914141
MD5 1374b516cebbdd2a1bd6f43cbe484b0c
BLAKE2b-256 ad576a1fcbf875d0858cd3315b1a4e55df983996eb6da42ee9cd84b0636169b1

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