ontolearn.ea_algorithms

Evolutionary algorithms (for Evolearner).

Module Contents

Classes

AbstractEvolutionaryAlgorithm

An abstract class for evolutionary algorithms.

BaseEvolutionaryAlgorithm

An abstract class for evolutionary algorithms.

EASimple

An abstract class for evolutionary algorithms.

RegularizedEvolution

An abstract class for evolutionary algorithms.

MultiPopulation

An abstract class for evolutionary algorithms.

Attributes

logger

ontolearn.ea_algorithms.logger
class ontolearn.ea_algorithms.AbstractEvolutionaryAlgorithm[source]

An abstract class for evolutionary algorithms.

__slots__ = ()
name: ClassVar[str]
abstract evolve(toolbox: deap.base.Toolbox, population: List[ontolearn.ea_utils.Tree], num_generations: int, start_time: float, verbose: bool = False) Tuple[bool, List[ontolearn.ea_utils.Tree]][source]
class ontolearn.ea_algorithms.BaseEvolutionaryAlgorithm[source]

Bases: AbstractEvolutionaryAlgorithm

An abstract class for evolutionary algorithms.

__slots__ = ()
evolve(toolbox: deap.base.Toolbox, population: List[ontolearn.ea_utils.Tree], num_generations: int, start_time: float, verbose: int = 0) Tuple[bool, List[ontolearn.ea_utils.Tree]][source]
abstract generation(toolbox: deap.base.Toolbox, population: List[ontolearn.ea_utils.Tree], num_selections: int = 0) Tuple[bool, List[ontolearn.ea_utils.Tree]][source]
class ontolearn.ea_algorithms.EASimple(crossover_pr: float = 0.9, mutation_pr: float = 0.1, elitism: bool = False, elite_size: float = 0.1)[source]

Bases: BaseEvolutionaryAlgorithm

An abstract class for evolutionary algorithms.

__slots__ = ('crossover_pr', 'mutation_pr', 'elitism', 'elite_size')
name: Final = 'EASimple'
crossover_pr: float
mutation_pr: float
elitism: bool
elite_size: float
generation(toolbox: deap.base.Toolbox, population: List[ontolearn.ea_utils.Tree], num_selections: int = 0) Tuple[bool, List[ontolearn.ea_utils.Tree]][source]
class ontolearn.ea_algorithms.RegularizedEvolution[source]

Bases: BaseEvolutionaryAlgorithm

An abstract class for evolutionary algorithms.

__slots__ = ()
name: Final = 'RegularizedEvolution'
generation(toolbox: deap.base.Toolbox, population: List[ontolearn.ea_utils.Tree], num_selections: int = 0) Tuple[bool, List[ontolearn.ea_utils.Tree]][source]
class ontolearn.ea_algorithms.MultiPopulation(base_algorithm: BaseEvolutionaryAlgorithm | None = None, migration_size: float = 0.1, num_populations: int = 4, iso_generations: float = 0.1, boost: float = 0.0)[source]

Bases: AbstractEvolutionaryAlgorithm

An abstract class for evolutionary algorithms.

__slots__ = ('base_algorithm', 'migration_size', 'num_populations', 'iso_generations', 'boost')
name: Final = 'MultiPopulation'
base_algorithm: BaseEvolutionaryAlgorithm
migration_size: float
num_populations: int
iso_generations: float
boost: float
evolve(toolbox: deap.base.Toolbox, population: List[ontolearn.ea_utils.Tree], num_generations: int, start_time: float, verbose: int = 0) Tuple[bool, List[ontolearn.ea_utils.Tree]][source]