Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate population from pre-defined individuals? #39

Closed
NamLQ opened this issue Mar 26, 2020 · 5 comments
Closed

How to generate population from pre-defined individuals? #39

NamLQ opened this issue Mar 26, 2020 · 5 comments

Comments

@NamLQ
Copy link

NamLQ commented Mar 26, 2020

Hi!

Suppose I have 100 solutions and have selected the five best ones. How can I generate 50 new individuals from the five best ones with pcrossover = 0.8 and pmutation = 0.1?

Thank you very much!

@luca-scr
Copy link
Owner

Maybe you want to use arg 'suggestions' in ga() function call.

@NamLQ
Copy link
Author

NamLQ commented Mar 26, 2020

If I use arg suggestions in ga(), the algorithm will calculate the fitness function base on the solutions I gave or the algorithm will generate new individuals and calculate the fitness from the new ones?

@luca-scr
Copy link
Owner

As described in the help page, the suggested solutions you provide will be included in the initial population, then the fitness function will be evaluated on that solutions and genetic operators applied as usual.

@NamLQ
Copy link
Author

NamLQ commented Mar 26, 2020

I use GA for feature selection in machine learning and the fitness function is time-consuming. So it is better if:

  • the algorithm accepts the fitness values of suggested solutions, or
  • the algorithm generates new individuals based on the suggested solutions, and the fitness function will only be evaluated on those new ones.

@luca-scr
Copy link
Owner

I will go with 2nd option and uses memoization to avoid evaluating again the fitness function of already known solutions. See the vignette for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants