ontolearn.learners.alcsat
ALCSAT Learner - SAT-based ALC concept learning.
Classes
ALCSAT: SAT-based ALC concept learner. |
Module Contents
- class ontolearn.learners.alcsat.ALCSAT(knowledge_base: AbstractKnowledgeBase, reasoner: owlapy.abstracts.AbstractOWLReasoner | None = None, max_runtime: int | None = 60, max_concept_size: int = 10, start_concept_size: int = 1, operators: Set | None = None, tree_templates: bool = True, type_encoding: bool = True)[source]
Bases:
ontolearn.learners.sat_base.SATBaseLearnerALCSAT: SAT-based ALC concept learner.
This learner uses SAT solvers to find ALC concept expressions that fit positive and negative examples. It encodes the concept learning problem as a SAT problem and uses a Glucose SAT solver to find solutions.
The algorithm incrementally searches for concepts of increasing size (tree depth k) that maximize the accuracy on the given examples.
- kb
The knowledge base that the concept learner is using.
- Type:
- max_concept_size
Maximum size (depth) of concepts to search for.
- Type:
int
- start_concept_size
Starting size for incremental search.
- Type:
int
- operators
Set of ALC operators to use (NEG, AND, OR, EX, ALL).
- Type:
Set
- tree_templates
Whether to use tree templates for symmetry breaking.
- Type:
bool
- type_encoding
Whether to use type encoding optimization.
- Type:
bool
- timeout
Timeout in seconds for the SAT solver (-1 for no timeout).
- Type:
float
- _best_hypothesis
Best found hypothesis.
- Type:
OWLClassExpression
- _best_hypothesis_accuracy
Accuracy of the best hypothesis.
- Type:
float
- _ind_to_owl
Mapping from internal individual indices to OWL individuals.
- Type:
dict
- _owl_to_ind
Mapping from OWL individuals to internal indices.
- Type:
dict
- __slots__ = ('max_concept_size', 'start_concept_size', 'operators', 'tree_templates', 'type_encoding')
- name = 'alcsat'
- max_concept_size = 10
- start_concept_size = 1
- operators = None
- tree_templates = True
- type_encoding = True
- fit(lp: PosNegLPStandard)[source]
Find ALC concept expressions that explain positive and negative examples.
- Parameters:
lp – Learning problem with positive and negative examples.
- Returns:
self