xlemoo.utilities
- XLEMOO.utilities.complete_missing_rules(lemoo: LEMOO, rules_for_vars: dict) dict[source]
Completes the missing rules contained in a dict. For the contents of the dict, see the function
parse_skoped_rules(). The completing of the missing rules utilizes the final population generated by a trained LEMOO model by taking the lower and upper bounds of the population for each variables with missing bounds in the rules defined in rules_for_vars.- Parameters:
lemoo (LEMOO) – A trained LEMOO model.
rules_for_vars (dict) – A dict with each key representing a variable. Each entry contains another dict representing a variable’s upper and lower bounds. See
parse_skoped_rules()for additional details.
- Returns:
A dictionary with completed missing rules. If a rule was completed utilizing the bounds in the population, its accuracy is set to -1.
- Return type:
dict
- XLEMOO.utilities.parse_skoped_rules(lemoo: LEMOO, problem: MOProblem) dict[source]
Parses the rules from a trained LEMOO model that utilizes skoped rules in its learning mode and returns a dict with an entry for each variable describing its upper and lower bounds according to the extracted rules.
- Parameters:
lemoo (LEMOO) – A trained LEMOO model.
problem (MOProblem) – A multiobjective optimization problem.
- Returns:
A dict with each key representing a variable rules have been parsed for. Each entry is a dict with keys representing either the ‘>’ or ‘<=’ operator. The value behind the keys represented by these operators is the corresponding lower or upper bound of the variable, respectively. Example:
{'x0': {'>': 2.5, <=': 5.2}}.- Return type:
dict
- XLEMOO.utilities.print_rules(lemoo: LEMOO, rules_for_vars: dict, tex: bool = False) None[source]
Prints the rules contained in a dict. Either as plain text or as a raw LaTeX table. For the structure of this dict, see the function
parse_skoped_rules().- Parameters:
lemoo (LEMOO) – A trained LEMOO model.
rules_for_vars (dict) – A dict with rules for each variable. See
parse_skoped_rules().tex (bool, optional) – Whether to print the output as a raw LaTeX table or not. Defaults to False.
- Returns:
None