Comments (2)
From marc.andre.gardner on April 21, 2012 23:19:55
Actually, "icls" and "scls" are not class names, but arbitrary defined parameters names (see the definition of generateES above).
In DEAP, the toolbox is only a practical tool to register operators or functions so they can be used easily in different context. It is also very useful when you want to experiment many algorithms for a given task, as you simply have to change the corresponding toolbox.register line to apply the change everywhere.
Another useful feature of the toolbox is its ability to retain some keywords arguments, which would be useless to repeat at each call (for instance, the class representing an individul, which generally not change at all during evolution). For example, if you want to register a simple GA mutation, say mutGaussian(individual, mu, sigma, indpb), you may end up with that :
toolbox.register("mutate", tools.mutGaussian, mu=0, sigma=1, indpb=0.2)
Thereafter, you may call :
toolbox.mutate(individual)
as the mu, sigma and indpb parameters have been set to specific values, instead of repeating those constant values everywhere the mutate function is called.
In your specific case, icls is simply the class representing an individual (like creator.Individual) and scls a class representing the strategy (like creator.Strategy in this example). It is up to you to define those classes so they match your needs.
In this example, those definitions are very simple (Python arrays, which is more or less like a std::vector in C++), but you can build up your own class.
I suggest you the read the documentation introduction ( http://deap.gel.ulaval.ca/doc/0.8/tutorials/start.html ) to learn more about DEAP specific structure. In any way, questions of this kind should normally be posted on the deap-users mailing list ( https://groups.google.com/forum/?fromgroups#!forum/deap-users); it is more easier afterwards to find which question had already be answered.
I close this bug (as it is not really one), maybe we could take a look to this example description to make it clearer.
Status: Invalid
from deap.
From [email protected] on April 22, 2012 03:29:50
Hi Marc Andre,
I will put my further questions into the google group from now on, but I just wanted to thank you for your elaborate answer. I totally get it now.
As for the documentation: I already applaud the extensive and overall very clear documentation. It got me to understand and play around quite a lot (even though I am a relative novice at Python). I found a few minor errors in the documentation which I wanted to correct or clarify, but which are too little to send messages for. So I just created a clone of the project to see if I can maybe contribute a little back for all the good work you guys do.
For the rest: keep up the good work, it's much appreciated!
Cheers
from deap.
Related Issues (20)
- MultiStatistics class supports different functions for each Statistics object
- Support for Linux ARM aarch64 HOT 5
- In the example bbob.py,how can I get the "fgeneric" and "bbobbenchmarks" module? HOT 1
- Improve convergence performance(array dimensions question)
- Support Python 3.11 and 3.12, including wheels on PyPI
- AttributeError: 'list' object has no attribute 'fitness' HOT 8
- scaling in deap.tools.uniform_reference_points HOT 1
- question about the height of gp tree HOT 1
- TypeError: Population must be a sequence. For dicts or sets, use sorted(d) HOT 7
- question about kfold
- Getting the Pareto Front for every generation
- Seeking Help for "ValueError: too many values to unpack" Issue in Python Program HOT 1
- cxSimulatedBinaryBounded raises Exception with various eta
- selNSGA3WithMemory fails if passed uniform_reference_points where nobj = 1
- gp.cxSemantic causes polyploidy
- How to use GA to find optimal set of solutions for multi-objective functions HOT 6
- Bug in released deap 1.4.1 on PyPI
- Fitness Comparation using a aggregated variable instead of lexicographic comparation
- ImportError: No module named copyreg HOT 1
- Callback Function in Deap HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deap.