ontolearn.ea_initialization

Initialization for evolutionary algorithms.

Attributes

Property

Object

Classes

RandomInitMethod

Generic enumeration.

AbstractEAInitialization

Abstract base class for initialization methods for evolutionary algorithms.

EARandomInitialization

Rnndom initialization methods for evolutionary algorithms.

PropObjPair

EARandomWalkInitialization

Random walk initialization for description logic learning.

Module Contents

class ontolearn.ea_initialization.RandomInitMethod[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

GROW: Final
FULL: Final
RAMPED_HALF_HALF: Final
class ontolearn.ea_initialization.AbstractEAInitialization[source]

Abstract base class for initialization methods for evolutionary algorithms.

__slots__ = ()
abstract get_population(container: Callable, pset: deap.gp.PrimitiveSetTyped, population_size: int = 0) List[ontolearn.ea_utils.Tree][source]
abstract get_expression(pset: deap.gp.PrimitiveSetTyped) ontolearn.ea_utils.Tree[source]
class ontolearn.ea_initialization.EARandomInitialization(min_height: int = 3, max_height: int = 6, method: RandomInitMethod = RandomInitMethod.RAMPED_HALF_HALF)[source]

Bases: AbstractEAInitialization

Rnndom initialization methods for evolutionary algorithms.

__slots__ = ('min_height', 'max_height', 'method')
min_height: int
max_height: int
method: RandomInitMethod
get_population(container: Callable, pset: deap.gp.PrimitiveSetTyped, population_size: int = 0) List[ontolearn.ea_utils.Tree][source]
get_expression(pset: deap.gp.PrimitiveSetTyped, type_: type = None) ontolearn.ea_utils.Tree[source]
ontolearn.ea_initialization.Property
ontolearn.ea_initialization.Object
class ontolearn.ea_initialization.PropObjPair[source]
property_: Property
object_: Object
class ontolearn.ea_initialization.EARandomWalkInitialization(max_t: int = 2, jump_pr: float = 0.5)[source]

Bases: AbstractEAInitialization

Random walk initialization for description logic learning.

__slots__ = ('max_t', 'jump_pr', 'type_counts', 'dp_to_prim_type', 'dp_splits', 'kb')
connection_pr: float = 0.5
max_t: int
jump_pr: float
type_counts: Dict[owlapy.class_expression.OWLClass, int]
dp_to_prim_type: Dict[owlapy.owl_property.OWLDataProperty, Any]
dp_splits: Dict[owlapy.owl_property.OWLDataProperty, List[owlapy.owl_literal.OWLLiteral]]
kb: KnowledgeBase
get_population(container: Callable, pset: deap.gp.PrimitiveSetTyped, population_size: int = 0, pos: List[owlapy.owl_individual.OWLNamedIndividual] = None, dp_to_prim_type: Dict[owlapy.owl_property.OWLDataProperty, Any] = None, dp_splits: Dict[owlapy.owl_property.OWLDataProperty, List[owlapy.owl_literal.OWLLiteral]] = None, kb: KnowledgeBase = None) List[ontolearn.ea_utils.Tree][source]
get_expression(pset: deap.gp.PrimitiveSetTyped, ind: owlapy.owl_individual.OWLNamedIndividual = None) ontolearn.ea_utils.Tree[source]