ontolearn.learners.tree_learner_refinement_inherit
Attributes
Classes
Tree-based Description Logic Concept Learner |
Module Contents
- ontolearn.learners.tree_learner_refinement_inherit.logger
- class ontolearn.learners.tree_learner_refinement_inherit.TDL_refinement(knowledge_base, use_inverse: bool = False, use_data_properties_numeric: bool = True, use_data_properties_boolean: bool = True, use_data_properties_string: bool = True, use_data_properties_date: bool = True, use_nominals: bool = False, use_card_restrictions: bool = True, kwargs_classifier: dict = None, max_runtime: int = None, grid_search_over: dict = None, grid_search_apply: bool = False, kwargs_grid_search: dict = None, report_classification: bool = False, plot_tree: bool = False, plot_embeddings: bool = False, plot_feature_importance: bool = False, verbose: int = 10, verbalize: bool = False, feature_refinement: bool = True, plot_importance_evo: bool = False, refine_iterations: int = 3, topk: int = 30)[source]
Bases:
ontolearn.learners.TDLTree-based Description Logic Concept Learner
- feature_refinement = True
- plot_importance_evo = False
- refine_iterations = 3
- topk = 30
- concept_per_iteration: List = []
- top_feature_dicts: List = []
- initial_importance_dict: Dict
- use_data_properties
- data_property_datatype_dict: Dict[owlapy.owl_property.OWLDataProperty, owlapy.owl_datatype.OWLDatatype]
- extract_expressions_from_owl_individuals(individuals: List[owlapy.owl_individual.OWLNamedIndividual], start_time: float = None) Tuple[numpy.ndarray, List[owlapy.class_expression.OWLClassExpression]][source]
- plot_perm_feature_importances(perm_importance_result, feat_name)[source]
bar plot the permutation feature importance
- plot_shap_feature_importances(shap_vals, feat_name)[source]
Bar plot the mean absolute SHAP feature importance
- refine_numerical_features(topk_expressions: list[owlapy.class_expression.OWLClassExpression], iteration: int)[source]
Refine numerical features based on data property values and fitted distributions.
- fit(learning_problem: PosNegLPStandard = None, max_runtime: int = None)[source]
Fit the learner to the given learning problem
Extract multi-hop information about E^+ and E^-.
Create OWL Class Expressions from (1)
Build a binary sparse training data X where first |E+| rows denote the binary representations of positives Remaining rows denote the binary representations of E⁻
Create binary labels.
Train a decision tree classifier on (3) and (4)
(6) If feature refinement is enabled, refine the numerical dp features based on SHAP values and data property ranges. (4) Construct a set of DL concept for each e in E^+ (5) Union (4)
- Parameters:
learning_problem – The learning problem
:param max_runtime:total runtime of the learning