ontolearn.heuristics
Heuristic functions.
Classes
Heuristic like the CELOE Heuristic in DL-Learner. |
|
DLFOIL Heuristic. |
|
OCEL Heuristic. |
|
Reward function for DRILL. |
Module Contents
- class ontolearn.heuristics.CELOEHeuristic(*, gainBonusFactor: float = 0.3, startNodeBonus: float = 0.1, nodeRefinementPenalty: float = 0.001, expansionPenaltyFactor: float = 0.1)[source]
Bases:
ontolearn.abstracts.AbstractHeuristic
[ontolearn.abstracts.AbstractOEHeuristicNode
]Heuristic like the CELOE Heuristic in DL-Learner.
- __slots__ = ('gainBonusFactor', 'startNodeBonus', 'nodeRefinementPenalty', 'expansionPenaltyFactor')
- name: Final = 'CELOE_Heuristic'
- gainBonusFactor: Final[float]
- startNodeBonus: Final[float]
- nodeRefinementPenalty: Final[float]
- expansionPenaltyFactor: Final[float]
- apply(node: AbstractOEHeuristicNode, instances, learning_problem: EncodedLearningProblem)[source]
Apply the heuristic on a search tree node and set its heuristic property to the calculated value.
- Parameters:
node – Node to set the heuristic on.
instances (set, optional) – Set of instances covered by this node.
learning_problem – Underlying learning problem to compare the heuristic to.
- class ontolearn.heuristics.DLFOILHeuristic[source]
Bases:
ontolearn.abstracts.AbstractHeuristic
DLFOIL Heuristic.
- __slots__ = ()
- name: Final = 'custom_dl_foil'
- apply(node, instances, learning_problem: EncodedPosNegUndLP)[source]
Apply the heuristic on a search tree node and set its heuristic property to the calculated value.
- Parameters:
node – Node to set the heuristic on.
instances (set, optional) – Set of instances covered by this node.
learning_problem – Underlying learning problem to compare the heuristic to.
- class ontolearn.heuristics.OCELHeuristic(*, gainBonusFactor: float = 0.5, expansionPenaltyFactor: float = 0.02)[source]
Bases:
ontolearn.abstracts.AbstractHeuristic
OCEL Heuristic.
- __slots__ = ('accuracy_method', 'gainBonusFactor', 'expansionPenaltyFactor')
- name: Final = 'OCEL_Heuristic'
- accuracy_method
- gainBonusFactor
- expansionPenaltyFactor
- apply(node: LBLNode, instances, learning_problem: EncodedPosNegLPStandard)[source]
Apply the heuristic on a search tree node and set its heuristic property to the calculated value.
- Parameters:
node – Node to set the heuristic on.
instances (set, optional) – Set of instances covered by this node.
learning_problem – Underlying learning problem to compare the heuristic to.