Skip to main content

Nature Based Algorithm Library

Project description

natureAlgo: Nature-Inspired Optimization Library

natureAlgo is a Python library for nature-inspired optimization algorithms. It provides implementations of optimization algorithms inspired by the behavior of natural systems, such as bees. It was created as a demo library to understand how to publish libraries to pypi.

Features

  • Implementation of the Artificial Bee Colony (ABC) algorithm.

  • Easily extendable for adding more nature-inspired optimization algorithms.

Installation

You can install natureAlgo via pip:

pip install natureAlgo

Usage

import pandas as pd

import numpy as np

from natureAlgo import bee_colony



# Create a sample DataFrame for optimization

data = pd.DataFrame(np.random.rand(10, 2), columns=['Feature1', 'Feature2'])



# Define the objective function

def objective_function(x):

    return sum([x_i ** 2 for x_i in x])



# Initialize the ABC algorithm

abc = bee_colony.ArtificialBeeColony(data, objective_function, max_iterations=100, num_employed=10, num_onlookers=10)



# Run the ABC algorithm

abc.run()



# Get the best solution and its fitness

best_solution = abc.best_solution

best_fitness = abc.best_fitness



print("Best solution:", best_solution)

print("Best fitness:", best_fitness)

Contributing

Contributions are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

The ABC algorithm implementation and README.md template were provided by OpenAI's ChatGPT.

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

natureAlgo-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

natureAlgo-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file natureAlgo-0.1.0.tar.gz.

File metadata

  • Download URL: natureAlgo-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.4

File hashes

Hashes for natureAlgo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec0bda4589c3ee0aece57017b762b3bce088dbd4c39b4d790336e008c1d7a444
MD5 9b705278da2e7a9a83bf17a55fdd7cec
BLAKE2b-256 26c7bcb91a7d499258de6dd182e16cdf43197e7b2cc084dd571ce893c3391a5f

See more details on using hashes here.

File details

Details for the file natureAlgo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: natureAlgo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.4

File hashes

Hashes for natureAlgo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 132b24bfd484bddda17e818743a0d49be4df596d54a9494d7ee222f07797a070
MD5 04812f45019a4ff62f2c0c1224afd49e
BLAKE2b-256 a78074eeef13f0f9f35ab52c06ee436611aa9aa8a1a4ea4fef7510e555407ca4

See more details on using hashes here.

Supported by

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