Skip to main content

Python Algorithms for Estimation of Distribution Algorithms

Project description

pateda — Python Algorithms for Estimation of Distribution Algorithms

PyPI version Python 3.9+ License: MIT

pateda is a comprehensive Python library for Estimation of Distribution Algorithms (EDAs) supporting discrete, integer, continuous, and permutation-based optimization. It is a clean, PyPI-ready package extracted from the PATEDA research framework developed at the University of the Basque Country (EHU/UPV).

Features

Classical discrete EDAs

Algorithm Class / function Problem type
UMDA LearnUMDA / SampleFDA Binary / integer
PBIL LearnPBIL Binary
FDA LearnFDA / SampleFDA Binary / integer
CFDA LearnCFDA / SampleCFDA Binary
CUMDA LearnCUMDA / SampleCUMDA Binary
BMDA LearnBMDA Binary
EBNA LearnEBNA Binary
BOA LearnBOA Binary
MN-FDA LearnMNFDA / LearnMNFDAG Binary / integer
Tree-EDA LearnTreeModel Binary / integer
Mixture Trees LearnMixtureTrees Binary
MIMIC LearnMIMIC Binary
BSC LearnBSC Binary
MOA LearnMOA Multi-objective
Affinity LearnAffinityFactorization Binary
Markov LearnMarkovChain Sequences

Continuous EDAs

Algorithm Learning Sampling
Gaussian Univariate (UMDA-G) learn_gaussian_univariate sample_gaussian_univariate
Gaussian Full (EMNA) learn_gaussian_full sample_gaussian_full
Mixture of Gaussians learn_mixture_gaussian_* sample_mixture_gaussian_*
GMRF-EDA learn_gmrf_eda* sample_gmrf_eda
Vine Copula EDA (optional) learned automatically sample_vine_copula

Permutation EDAs

Algorithm Learning Sampling
Mallows EDA (Kendall) LearnMallowsKendall SampleMallowsKendall
EHM / NHM LearnEHM / LearnNHM SampleEHM / SampleNHM

Supporting components

Component Subpackage Notes
Selection pateda.selection Truncation, tournament, Boltzmann, SUS, proportional, ranking, non-dominated
Mutation pateda.mutation Bit-flip, frequency-balance
Crossover pateda.crossover Block, two-point, transposition
Seeding pateda.seeding Random, biased, constrained
Replacement pateda.replacement Elitist, generational
Repairing pateda.repairing Unitation, trigonometric, bounds
Local Opt pateda.local_optimization Greedy search, simulated annealing, scipy wrapper
Stop cond. pateda.stop_conditions Max generations, optimum found
Statistics pateda.statistics Per-generation tracking, population stats
Knowledge pateda.knowledge_extraction Dependency analysis, MI, model visualization

Benchmark functions

Discrete: OneMax, Deceptive-3, Trap, NK-landscape, SAT, UBQP, Ising, HP-Protein, Additive Decomposable, Contiguous Block
Continuous: Sphere, Rosenbrock, Rastrigin, Ackley, GNBG instances
Permutation: TSP, LOP, QAP

Installation

pip install pateda

Optional extras:

pip install "pateda[copula]"   # vine-copula EDAs (pyvinecopulib)
pip install "pateda[dev]"      # development tools
pip install "pateda[all]"      # everything

For neural-network-based EDAs (VAE, GAN, Diffusion, etc.) install the companion package:

pip install pateda-nn

Quick start

import numpy as np
from pateda import EDA, EDAComponents
from pateda.seeding import RandomInit
from pateda.learning import LearnUMDA
from pateda.sampling import SampleFDA
from pateda.selection import TruncationSelection
from pateda.stop_conditions import MaxGenerations
from pateda.functions.discrete.onemax import onemax

n_vars = 50
cardinality = np.full(n_vars, 2)

components = EDAComponents(
    seeding=RandomInit(),
    learning=LearnUMDA(),
    sampling=SampleFDA(),
    selection=TruncationSelection(),
    stop_condition=MaxGenerations(max_gen=100),
    selection_params={"selection_size": 150},
)

eda = EDA(
    pop_size=300,
    n_vars=n_vars,
    fitness_func=onemax,
    cardinality=cardinality,
    components=components,
    random_seed=42,
)
stats, cache = eda.run()
print(f"Best: {stats.best_fitness_overall}")

See examples/ for more complete demos covering discrete, continuous, permutation, and multi-objective problems.

Project structure

pateda/
├── src/
│   └── pateda/
│       ├── core/           # EDA engine (EDA, EDAComponents, Model)
│       ├── learning/       # Probabilistic model learning
│       ├── sampling/       # Model-based sampling
│       ├── selection/      # Selection operators
│       ├── seeding/        # Population initialisation
│       ├── mutation/       # Mutation operators
│       ├── crossover/      # Crossover operators
│       ├── replacement/    # Replacement strategies
│       ├── repairing/      # Constraint repair
│       ├── stop_conditions/# Termination criteria
│       ├── local_optimization/ # Local search wrappers
│       ├── functions/      # Benchmark objective functions
│       ├── inference/      # MAP inference
│       ├── statistics/     # Run-time statistics
│       └── knowledge_extraction/ # Model analysis tools
├── tests/
├── examples/
├── pyproject.toml
└── README.md

Citation

If you use pateda in academic work, please cite:

@misc{pateda,
  author  = {Roberto Santana},
  title   = {pateda: Python Algorithms for Estimation of Distribution Algorithms},
  year    = {2024},
  url     = {https://github.com/rsantana-isg/pateda},
}

License

MIT — see LICENSE.

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

pateda-0.1.0.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

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

pateda-0.1.0-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pateda-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pateda-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a77a11a965a04619314c5443488c7a2f2052f82af4917556eb16ba604acabd42
MD5 352c045e32beb3363e2b2a72a9070d9a
BLAKE2b-256 b018740b0c4c5e090cec4926c01185dab48f752a8c3600ae17e439d9e86c634a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pateda-0.1.0.tar.gz:

Publisher: publish.yml on rsantana-isg/pateda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pateda-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pateda-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c52014714bf9f477ca7653c4e114013218aeced9354473cc9a8d279b3e7f63b
MD5 c438de2ebfa5c68af5014b35557461f3
BLAKE2b-256 df500a59450285aeeba1485b3808fc8da3e2f3b49d63008dafce554e1677d427

See more details on using hashes here.

Provenance

The following attestation bundles were made for pateda-0.1.0-py3-none-any.whl:

Publisher: publish.yml on rsantana-isg/pateda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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