Giter VIP home page Giter VIP logo

Comments (2)

cmd-ntrf avatar cmd-ntrf commented on July 25, 2024

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.

cmd-ntrf avatar cmd-ntrf commented on July 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.