opytimizer.optimizers.evolutionary.gsgp

Geometric Semantic Genetic Programming.

class opytimizer.optimizers.evolutionary.gsgp.GSGP(params: Optional[Dict[str, Any]] = None)

A GSGP class, inherited from GP.

This is the designed class to define GSGP-related variables and methods.

References

A. Moraglio, K. Krawiec, and C. G. Johnson. Geometric semantic genetic programming. Lecture Notes in Computer Science (2012).

G. H. de Rosa, J. P. Papa, and L. P. Papa. Feature selection using geometric semantic genetic programming. Proceedings of the Genetic and Evolutionary Computation Conference Companion (2017).

__init__(params: Optional[Dict[str, Any]] = None) → None

Initialization method.

Parameters:params – Contains key-value parameters to the meta-heuristics.
_mutation(space: opytimizer.spaces.tree.TreeSpace) → None

Mutates a number of individuals pre-selected through a tournament procedure.

Parameters:space – A TreeSpace object.
_mutate(tree: opytimizer.core.node.Node, n_variables: int, max_nodes: int) → opytimizer.core.node.Node

Actually performs the mutation on a single tree.

Parameters:
  • tree – A Node instance to be mutated.
  • n_variables – Number of variables.
  • max_nodes – Maximum number of nodes to be searched.
Returns:

A mutated tree.

Return type:

(Node)

_crossover(space: opytimizer.spaces.tree.TreeSpace) → None

Crossover a number of individuals pre-selected through a tournament procedure.

Parameters:space – A TreeSpace object.
_cross(father: opytimizer.core.node.Node, mother: opytimizer.core.node.Node, n_variables: int, max_father: int, max_mother: int) → opytimizer.core.node.Node

Actually performs the crossover over a father and mother nodes.

Parameters:
  • father – A father’s node to be crossed.
  • mother – A mother’s node to be crossed.
  • n_variables – Number of variables.
  • max_father – Maximum of nodes from father to be used.
  • max_mother – Maximum of nodes from mother to be used.
Returns:

Single offspring based on the crossover operator.

Return type:

(Node)