ontolearn.learning_problem_generator
Learning problem generator.
Attributes
Classes
Learning problem generator. |
Module Contents
- ontolearn.learning_problem_generator.SearchAlgos
- class ontolearn.learning_problem_generator.LearningProblemGenerator(knowledge_base: KnowledgeBase, refinement_operator=None, num_problems=10000, num_diff_runs=100, min_num_instances=None, max_num_instances=sys.maxsize, min_length=3, max_length=5, depth=3, search_algo='strict-dfs')[source]
Learning problem generator.
- kb
- rho
- search_algo
- min_num_instances
- max_num_instances
- min_length
- max_length
- valid_learning_problems = []
- depth
- num_diff_runs
- num_problems
- export_concepts(concepts: List[Node], path: str)[source]
Serialise the given concepts to a file.
- Parameters:
concepts (list) – Node objects.
path (str) – Filename base (extension will be added automatically).
- concept_individuals_to_string_balanced_examples(concept: owlapy.class_expression.OWLClassExpression) Dict[str, Set] [source]
- get_balanced_n_samples_per_examples(*, n=5, min_num_problems=None, max_length=None, min_length=None, num_diff_runs=None, min_num_instances=None, search_algo='strict-dfs') Iterable[Tuple[RL_State, Set[owlapy.owl_individual.OWLNamedIndividual], Set[owlapy.owl_individual.OWLNamedIndividual]]] [source]
We generate min_num_problems number of concepts.
For each concept, we generate n number of positive and negative examples.
Each example contains n samples.
- get_balanced_examples(*, min_num_problems=None, max_length=None, min_length=None, num_diff_runs=None, min_num_instances=None, search_algo='strict-dfs') list [source]
Generate valid examples with input search algorithm.
Balance valid examples.
- Returns:
A list of balanced tuples (s,p,n) where s denotes the string representation of a concept, p and n denote a set of URIs of individuals indicating positive and negative examples.
- get_examples(*, num_problems=None, max_length=None, min_length=None, num_diff_runs=None, min_num_ind=None, search_algo=None) list [source]
Get valid examples with input search algorithm.
- Returns:
A list of tuples (s,p,n) where s denotes the string representation of a concept, p and n denote a set of URIs of individuals indicating positive and negative examples.
- get_concepts(*, num_problems=None, max_length=None, min_length=None, max_num_instances=None, num_diff_runs=None, min_num_instances=None, search_algo=None) Generator [source]
Calls generate_examples