ontolearn.learners.sat_base

Base class for SAT-based concept learners.

Classes

SATBaseLearner

Base class for SAT-based concept learners that use the SPELL framework.

Module Contents

class ontolearn.learners.sat_base.SATBaseLearner(knowledge_base: AbstractKnowledgeBase, reasoner: owlapy.abstracts.AbstractOWLReasoner | None = None, max_runtime: int | None = 60, cache_structure: bool = True)[source]

Base class for SAT-based concept learners that use the SPELL framework.

This class provides common functionality for converting between OWL ontologies and the Structure format used by SPELL, as well as converting results back to OWL class expressions.

__slots__ = ('kb', 'reasoner', 'max_runtime', '_best_hypothesis', '_best_hypothesis_accuracy',...
kb
reasoner = None
max_runtime = 60
cache_structure = True
start_time = None
clean()[source]

Clear all states of the concept learner.

abstractmethod fit(lp: PosNegLPStandard)[source]

Find concept expressions that explain positive and negative examples.

Parameters:

lp – Learning problem with positive and negative examples.

Returns:

self

best_hypothesis() owlapy.class_expression.OWLClassExpression[source]

Get the best found hypothesis.

Returns:

OWL class expression, or OWLThing if no hypothesis found.

best_hypothesis_accuracy() float | None[source]

Get the accuracy of the best found hypothesis.

Returns:

Accuracy as float, or None if no hypothesis found.