ontolearn.learners.spell

SPELL Learner - SAT-based concept learning using SPELL fitting.

Classes

SPELL

SPELL: SAT-based concept learner using general SPELL fitting.

Module Contents

class ontolearn.learners.spell.SPELL(knowledge_base: AbstractKnowledgeBase, reasoner: owlapy.abstracts.AbstractOWLReasoner | None = None, max_runtime: int | None = 60, max_query_size: int = 10, starting_query_size: int = 1, search_mode: str = 'full_approx')[source]

Bases: ontolearn.learners.sat_base.SATBaseLearner

SPELL: SAT-based concept learner using general SPELL fitting.

This learner uses SAT solvers to find concept expressions that fit positive and negative examples. Unlike ALCSAT which is specialized for ALC, SPELL uses the more general fitting.py module which supports different modes of operation.

The algorithm incrementally searches for queries of increasing size that maximize the coverage on the given examples.

kb

The knowledge base that the concept learner is using.

Type:

AbstractKnowledgeBase

max_query_size

Maximum size of queries to search for.

Type:

int

search_mode

Search mode - exact, neg_approx, or full_approx.

_best_hypothesis

Best found hypothesis.

Type:

OWLClassExpression

_best_hypothesis_accuracy

Accuracy of the best hypothesis.

Type:

float

_structure

Internal structure representation of the knowledge base.

Type:

Structure

_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_query_size', 'starting_query_size', 'search_mode')
name = 'spell'
max_query_size = 10
starting_query_size = 1
search_mode
fit(lp: PosNegLPStandard)[source]

Find concept expressions that explain positive and negative examples.

Parameters:

lp – Learning problem with positive and negative examples.

Returns:

self