ontolearn.learners.tree_learner
Module Contents
Classes
Tree-based Description Logic Concept Learner |
Functions
|
|
|
|
|
Extract concise bounded description for each entity, where the entity is a subject entity. |
|
|
|
Reduces a list of OWLClassExpression instances into a single instance of OWLObjectUnionOf or OWLObjectIntersectionOf |
- ontolearn.learners.tree_learner.compute_quality(instances, pos, neg, conf_matrix=False, quality_func=None)[source]
- ontolearn.learners.tree_learner.extract_cbd(dataframe) Dict[str, List[Tuple[str, str]]] [source]
Extract concise bounded description for each entity, where the entity is a subject entity. Create a mapping from a node to out-going edges and connected nodes :param dataframe: :return:
- ontolearn.learners.tree_learner.concepts_reducer(concepts: List[owlapy.class_expression.OWLClassExpression], reduced_cls: Callable) owlapy.class_expression.OWLObjectUnionOf | owlapy.class_expression.OWLObjectIntersectionOf [source]
Reduces a list of OWLClassExpression instances into a single instance of OWLObjectUnionOf or OWLObjectIntersectionOf
- class ontolearn.learners.tree_learner.TDL(knowledge_base, use_inverse: bool = False, use_data_properties: bool = False, use_nominals: bool = False, use_card_restrictions: bool = False, quality_func: Callable = None, kwargs_classifier: dict = None, max_runtime: int = 1, grid_search_over: dict = None, grid_search_apply: bool = False, report_classification: bool = False, plot_tree: bool = False, plot_embeddings: bool = False)[source]
Tree-based Description Logic Concept Learner
- create_training_data(learning_problem: PosNegLPStandard) Tuple[pandas.DataFrame, pandas.Series] [source]
Create a training data (X,y) for binary classification problem, where X is a sparse binary matrix and y is a binary vector.
X: shape (n,d) y: shape (n,1).
n denotes the number of examples d denotes the number of features extracted from n examples.
- construct_owl_expression_from_tree(X: pandas.DataFrame, y: pandas.DataFrame) List[owlapy.class_expression.OWLObjectIntersectionOf] [source]
Construct an OWL class expression from a decision tree
- fit(learning_problem: PosNegLPStandard = None, max_runtime: int = None)[source]
Fit the learner to the given learning problem
(1) Extract multi-hop information about E^+ and E^- denoted by mathcal{F}. (1.1) E = list of (E^+ sqcup E^-). (2) Build a training data mathbf{X} in mathbb{R}^{ |E| imes |\mathcal{F}| } . (3) Create binary labels mathbf{X}.
Construct a set of DL concept for each e in E^+
Union (4)
- Parameters:
learning_problem – The learning problem
:param max_runtime:total runtime of the learning