You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in high probabilities for bad individuals and low probabilities for good individuals for minimization problems.
Example: Population with 2 individuals, individual_1 fitness -1 and individual_2 fitness -2. The probability of selecting individual_1 (the good one) is 1/3 and probability of selecting individual_2 (the bad one) is 2/3. It is more likely to select individuals with poor fitness.
A quick fix could be the use of the reciprocal value for minimization problems:
Hi,
the probability of selecting parents is calculated by (https://github.com/gkhayes/mlrose/blob/master/mlrose/opt_probs.py eval_mate_probs function):
self.mate_probs = pop_fitness/np.sum(pop_fitness)
This results in high probabilities for bad individuals and low probabilities for good individuals for minimization problems.
Example: Population with 2 individuals, individual_1 fitness -1 and individual_2 fitness -2. The probability of selecting individual_1 (the good one) is 1/3 and probability of selecting individual_2 (the bad one) is 2/3. It is more likely to select individuals with poor fitness.
A quick fix could be the use of the reciprocal value for minimization problems:
if self.maximize == 1:
self.mate_probs = pop_fitness / np.sum(pop_fitness)
else:
self.mate_probs = 1/pop_fitness / np.sum(1/pop_fitness)
The text was updated successfully, but these errors were encountered: