Questions tagged [deap]

DEAP is an evolutionary computation framework for rapid prototyping and testing of ideas

DEAP is a novel evolutionary computation framework for rapid prototyping and testing of ideas. It seeks to make algorithms explicit and data structures transparent. It works in perfect harmony with parallelisation mechanism such as multiprocessing and SCOOP.

Features:

  • Genetic algorithm using any imaginable representation
  • List, Array, Set, Dictionary, Tree, Numpy Array, etc.
  • Genetic programing using prefix trees
  • Loosely typed, Strongly typed
  • Automatically defined functions
  • Evolution strategies (including CMA-ES)
  • Multi-objective optimisation (NSGA-II, SPEA-II)
  • Co-evolution (cooperative and competitive) of multiple populations
  • Parallelization of the evaluations (and more)
  • Hall of Fame of the best individuals that lived in the population
  • Checkpoints that take snapshots of a system regularly
  • Benchmarks module containing most common test functions
  • Genealogy of an evolution (that is compatible with NetworkX)
  • Examples of alternative algorithms: Particle Swarm Optimization, Differential Evolution, - Estimation of Distribution Algorithm
173 questions
3
votes
0 answers

DEAP : making crossover probability a function of distance between individuals

I am trying to implement a niching strategy with speciation. I want individuals within the same niche to be more likely to mate than individuals from different niches. Does DEAP include a way to make the crossover probability for a pair of…
usernumber
  • 1,958
  • 1
  • 21
  • 58
3
votes
1 answer

How can I write a DEAP logbook as text file?

I'm working with DEAP for genetic algorithms. I got some results in a logbook. Logbook have its shape as appends of dictionary like below. {"gen": 0, "nevals": 200, "avg": 5678.124656362589, "std": 1665.10303246997, "min": 2414.709605862963, "max":…
Luterino
  • 41
  • 2
3
votes
1 answer

Python DEAP running on pySpark is unable to call creator function

Question I am trying to run a Python DEAP genetic algorithm in a Jupyter notebook with pySpark for parallelization. With some research I understand that the essence is to register a spark based map function with toolbox to allow spark to do the…
3
votes
1 answer

Using DEAP (genetic algorithm library) with spark

Is IT possible to use DEAP ( http://deap.readthedocs.io/en/master/) with a spark cluster to map the fitness evaluation function. I would like to run a GA but the fitness function is rather long and I was planning on distributing it on a spark…
Julien Denos
  • 79
  • 1
  • 9
3
votes
2 answers

Minimizing multi-objective function using DEAP

I'm trying to perform multi-objective optimisation by minimizing a custom function using the DEAP library. Although I'm getting decent results when minimizing for several objectives (targets), for more than 3 or 4 it fails to converge. Typically it…
Chris
  • 1,287
  • 12
  • 31
3
votes
2 answers

Saving DEAP results into pandas dataframe

Using DEAP package for genetic algorithm for a while. I have known the routine and get some valid results. But I want to know the variation of the fitness function among populations. With stats function, I can print the mean, std etc as the…
Han Zhengzu
  • 3,694
  • 7
  • 44
  • 94
3
votes
2 answers

How can I create a list with random numbers in different ranges for deap package in python

I am using DEAP package in Python to write a program for optimization with evolutionary algorithm specifically with Genetic. I need to create chromosomes by using list type in python. This chromosome should have five float genes (alleles) in…
Tekin
  • 554
  • 7
  • 17
3
votes
2 answers

How to plot multi-objectives pareto frontier with DEAP in Python

For the project I was working on, I set 3 different objectives as optimization target in DEAP, an evolution framework based on Python. It can cope with multi-objectives problem using algorithm like NSGA-II. Is there anyway to generate the pareto…
Han Zhengzu
  • 3,694
  • 7
  • 44
  • 94
3
votes
2 answers

Fitness sharing in DEAP

Is there any way to implement fitness sharing/niching using DEAP? Specifically I'm looking for an implementation of the method defined here (Goldberg's fitness sharing) on page 98 of the pdf. If you know of any other methods that are in DEAP, that…
David
  • 1,398
  • 1
  • 14
  • 20
2
votes
0 answers

I get an error when importing base from deap

When I try to import base from deap: from deap import creator, base, tools Traceback (most recent call last): File ~\AppData\Roaming\Python\Python310\site-packages\IPython\core\interactiveshell.py:3369 in run_code exec(code_obj,…
TKrogg19
  • 21
  • 3
2
votes
0 answers

How to use multiple mutation/crossover operators in DEAP python?

Is there a way in DEAP to use more than one mutation or more than one crossover with their own probability? The algorithms expect 'mate' and 'mutate' to be registered in the toolbox. I can technically create my own function that chooses which…
T.J.
  • 61
  • 5
2
votes
0 answers

Minimal DEAP script raises a confusing exception when max_ parameter is greater than 1 and fails to generate a program

I would like to use DEAP's genetic programming functionality to randomly generate some short Python scripts (that I'll later want to mutate and evolve). While learning how to use it, I am encountering an exception that I do not understand. The…
weemattisnot
  • 889
  • 5
  • 16
2
votes
0 answers

Creating a custom function to create individuals using DEAP

I am using DEAP to resolve a problem using a genetic algorithm. I need to create a custom function to generate the individuals. This function checks the values inside in order to append 0 or 1. Now I'm trying to register this function on the…
Dayana
  • 21
  • 1
2
votes
1 answer

Fitness function with multiple weights in DEAP

I'm learning to use the Python DEAP module and I have created a minimising fitness function and an evaluation function. The code I am using for the fitness function is below: ct.create("FitnessFunc", base.Fitness, weights=(-0.0001,…
JolonB
  • 415
  • 5
  • 25
2
votes
1 answer

Solving a multi-objective optimization problem using python DEAP library with NSGA2

I want to solve a multi-objective optimization problem using DEAP library. Since i am new in DEAP, i used this example of NSGA-II as a template for my own problem. In the example, in line 59, tools.selNSGA2 function is registered to toolbox object,…
Sina_Alef
  • 31
  • 6
1
2
3
11 12