GeneticPy is an optimizer that uses a genetic algorithm to quickly search through custom parameter spaces for optimal solutions.
Project description
GeneticPy
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
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e361a6e5e0fa7751fed30ca90b964cc18be35bbed71e319ff16370aaf91b1d19 |
|
MD5 | 3b90c663118db35ed48fbb3d4236587e |
|
BLAKE2b-256 | 5c43e33216b5256157bb1f8ce227db1e7581d04caf4889925b0757a575b4df03 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30a21abb1e04f9122be8ca045b572ef7ab204a71325823176285d8bebdde4ea |
|
MD5 | ddb84a1ebb16ca989a6a0583c4c22001 |
|
BLAKE2b-256 | 82b43a86c7b8f81d42ad0d00a60bab93221c15f39f6d4db36cff7daa46798480 |