Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
genetic_algorithm_tool [2012/09/13 05:08]
hermann [Notes]
genetic_algorithm_tool [2026/08/28 03:20] (current)
hermann Sync from local documentation review
Line 1: Line 1:
-====== Genetic Algorithm Tool ====== ​+====== Genetic Algorithm Tool ======
  
 ===== Description ===== ===== Description =====
  
-Global Optimization tool. Solves ​Genetic Algorithm ​that mimics ​the principle ​of biological evolution ​in a search for a global optimization solution for the contained model.+This container is global optimization tool that solves a genetic algorithm, mimicking ​the principles ​of biological evolution, to search for a global optimization solution for the model it contains. It evolves a population of candidate individuals across generations,​ guided by a fitness value that the contained model computes for each individual, and returns the best individual found across all generations. 
 + 
 +The [[Get Current Individual]] and [[Set Fitness]] functors must be placed inside this container: the former retrieves the individual being evaluated in the current iteration, and the latter reports the fitness value calculated for that individual back to this container.
  
 ===== Inputs ===== ===== Inputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Use Convergence Stopping Criteria ​ | [[ Bool Type| Bool]]  | If true, the optimization process ​will halt if evolution of generations becomes asymptotic, as defined by the asymptotic parameterOtherwise, the total number of generations specified by "Number Of Generations" is used.  | +| Use Convergence Stopping Criteria ​ | [[Boolean Value Type]] ​ | If true, the optimization process ​halts once the evolution of generations becomes asymptotic, as defined by Convergence LimitIf falsethe process runs for the total number of generations specified by Number Of Generations. ​ | 
-| Number ​of Generations ​ | [[Positive ​Int Type|Positive Int]]  | If the "Use Convergence Stopping Criteria" ​is true, the "​Number Of Generations" ​specifies the minimum number of generations to detect convergence. Otherwise, it becomes ​the maximum number of generations. ​ | +| Number ​Of Generations ​ | [[Positive ​Integer Value Type]] ​ | If Use Convergence Stopping Criteria is true, this specifies the minimum number of generations ​needed ​to detect convergence. Otherwise, it is the maximum number of generations. ​ | 
-| Population Size  | [[Positive ​Int Type|Positive Int]]  | Number of individuals per population. ​ | +| Population Size  | [[Positive ​Integer Value Type]] ​ | Number of individuals per population. ​ | 
-| Individual Genotype ​ | [[Lookup Table Group Type|Lookup Table Group  ​]]  | The genotype ​that defines the template for individuals. ​ | +| Individual Genotype ​ | [[Lookup Table Group Type]] ​ | Genotype ​that defines the template for individuals. ​ | 
-| Default Lower Bound  | [[Double ​Type|Double]]  | The default ​lower value for alleles. ​ | +| Default Lower Bound  | [[Real Value Type]] ​ | Default ​lower value for alleles. Must be less than Default Upper Bound.  | 
-| Default Upper Bound  | [[Double ​Type|Double]]  | The default ​upper value for alleles. ​ |+| Default Upper Bound  | [[Real Value Type]] ​ | Default ​upper value for alleles. ​ |
  
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
-^ Name ^ Type ^ Description ^ Default Value ^ +^ Name  ^ Type  ^ Description ​ ^ Default Value  
-| Convergence Limit | [[ Percent Type| Percent  ​]]  | Convergence limit (in percentage of fitness variationacross the given number of generations used to halt the optimization process. ​ | 0.99  | +| Convergence Limit  | [[Percent Type]] ​ | Convergence limit, as a percentage of fitness variation across the given number of generationsused to halt the optimization process ​when Use Convergence Stopping Criteria is true. This is an advanced port.  | 0.99  | 
-| Lower Bounds ​ | [[Lookup Table Group Type|Lookup Table Group ]]  | The lower limits per allelesIf omitted, the "Default Lower Bound" ​is used for missing limits.  | None  | +| Lower Bound  | [[Lookup Table Group Type]] ​ | Lower limits per alleleMissing limits fall back to Default Lower Bound. This is an advanced port.  | None  | 
-| Upper Bounds ​| [[Lookup Table Group Type|Lookup Table Group ]]  | The upper limits per allelesIf omitted, the "Default Upper Bound" ​is used for missing limits.  | None  | +| Upper Bound  ​| [[Lookup Table Group Type]] ​ | Upper limits per alleleMissing limits fall back to Default Upper Bound. This is an advanced port.  | None  | 
-| Meta Heuristic Evaluation Percent ​ | [[Percent Type|Percent  ​]]  | A percentage ​of individuals whose finesses are obtained via meta-heuristic ​estimation ​(in percentage of individuals).  | None  | +| Meta Heuristic Evaluation Percent ​ | [[Percent Type]] ​ | Percentage ​of individuals whose fitness is estimated using a meta-heuristic (KNNinstead of being calculated by the contained model. This is an advanced port.  | None  | 
-| Maximum Log Level  | [[Log Tag Type|Log Tag  ​]]  | Maximum log level used to run the contained functors. ​ | Warning ​ |+| Maximum Log Level  | [[Log Tag Type]] ​ | Maximum log level used while running ​the contained functors. This is an advanced port.  | Warning ​ | 
 +| Sequence Input  | [[None Type]] ​ | Ensures that the functor connected to this port runs before this container. ​ | None  |
  
 ===== Outputs ===== ===== Outputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Best Individual ​ | [[ Lookup Table Group Type|Lookup Table Group  ​]]  | The resulting best individual ​from all generations. ​ | +| Best Individual ​ | [[Lookup Table Group Type]] ​ | Best individual ​found across ​all generations. ​ | 
-| Best Individual Fitness ​ | [[Double ​Type|Double  ​]]  | The '​fitness'​ score of the overall best individual. ​ | +| Best Individual Fitness ​ | [[Real Value Type]] ​ | Fitness value of the overall best individual. ​ | 
-Worst Fitness Per Generation | [[Double ​Type|Double ​ ​]] ​ | The '​fitness'​ score of the worst individual ​per generation. ​ |+Best Fitness Per Generation ​ | [[Lookup Table Type]]  ​Fitness value of the best individual, for each generation. ​ 
 +| Worst Fitness Per Generation ​ | [[Lookup Table Type]]  | Fitness value of the worst individual, for each generation.  | 
 +| Sequence Output ​ | [[None Type]] ​ | Ensures that this container runs before the functor connected to this port.  |
  
 ===== Group ===== ===== Group =====
  
 [[Functor List#​Calibration | Calibration]] [[Functor List#​Calibration | Calibration]]
 +
 +===== Internal Outputs =====
 +
 +^ Name  ^ Type  ^ Description ​ ^
 +| Current Individual ​ | [[Lookup Table Group Type]] ​ | Individual being evaluated in the current iteration. ​ |
 +
 +===== Internal Inputs =====
 +
 +^ Name  ^ Type  ^ Description ​ ^
 +| Fitness ​ | [[Real Value Type]] ​ | Fitness value calculated for the current individual. ​ |
  
 ===== Notes ===== ===== Notes =====
  
-To calibrate Weights ​of Evidence coefficients, the ".dcf" file representing the Weight ​of Evidence ranges and coefficients can be converted ​into the corresponding set of ".csv" tables and back to the original format using the [[weights_of_evidence_file_conversion|ConvertWeightFiles utility]].  +A summary ​of the algorithm this container implements: firstan initial population is generated using Individual Genotype as a seed and the given bounds as limits for each alleleThen, for each generation, the fitness of every individual is calculated and the best individual is recorded; a portion of the population is selected through tournament, and those individuals are reproduced through crossover and mutation to form the next generation. This repeats until the stopping criteria set by Use Convergence Stopping Criteria is reached, at which point the best individual found across all generations is returned. 
-===== Internal Name ===== + 
 +When Use Convergence Stopping Criteria is true, convergence is detected when the best fitness value has not improved by at least the minimum percentage (1 - Convergence Limit) across the window formed by the last Number Of Generations generations. 
 + 
 +When Meta Heuristic Evaluation Percent is set, that percentage of individuals have their fitness estimated with the [[wp>​K-nearest_neighbor_algorithm|KNN algorithm]] instead of being evaluated by the contained model. This estimation is only used after a portion of the generations have run (typically 30% of the total), so that the KNN algorithm has enough prior results to estimate from. 
 + 
 +A "dcf" file holding Weights ​of Evidence ranges and coefficients can be converted ​to a corresponding set of "​csv"​ tablesand back, with the [[Weights Of Evidence File Conversion|ConvertWeightFiles utility]], which is useful for calibrating those coefficients with this container. 
 + 
 +Reports an error if Default Lower Bound is not less than Default Upper Bound. 
 + 
 +Reports an error if Use Convergence Stopping Criteria is true and Convergence Limit is zero. 
 + 
 +Reports a warning that cancelling or interrupting the execution of a model using this container may crash the application. 
 + 
 +===== Internal Name =====
  
 GeneticAlgorithmTool GeneticAlgorithmTool