:py:mod:`ontolearn.utils` ========================= .. py:module:: ontolearn.utils .. autoapi-nested-parse:: Ontolearn utils. Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 log_config/index.rst oplogging/index.rst static_funcs/index.rst Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: ontolearn.utils.setup_logging ontolearn.utils.compute_f1_score ontolearn.utils.parametrized_performance_debugger ontolearn.utils.performance_debugger ontolearn.utils.create_experiment_folder ontolearn.utils.serializer ontolearn.utils.deserializer ontolearn.utils.apply_TSNE_on_df ontolearn.utils.balanced_sets ontolearn.utils.read_csv ontolearn.utils.assertion_path_isfile ontolearn.utils.sanity_checking_args ontolearn.utils.read_individuals_file ontolearn.utils.read_named_classes_file Attributes ~~~~~~~~~~ .. autoapisummary:: ontolearn.utils.Factory ontolearn.utils.DEFAULT_FMT ontolearn.utils.flag_for_performance .. py:function:: setup_logging(config_file='ontolearn/logging.conf') Setup logging. :param config_file: Filepath for logs. :type config_file: str .. py:function:: compute_f1_score(individuals, pos, neg) -> float Compute F1-score of a concept .. py:data:: Factory .. py:data:: DEFAULT_FMT :value: 'Func:{name} took {elapsed:0.8f}s' .. py:data:: flag_for_performance :value: False .. py:function:: parametrized_performance_debugger(fmt=DEFAULT_FMT) .. py:function:: performance_debugger(func_name) .. py:function:: create_experiment_folder(folder_name='Log') .. py:function:: serializer(*, object_: object, path: str, serialized_name: str) .. py:function:: deserializer(*, path: str, serialized_name: str) .. py:function:: apply_TSNE_on_df(df) -> None .. py:function:: balanced_sets(a: set, b: set) -> Tuple[Set, Set] Balance given two sets through sampling without replacement. Returned sets have the same length. @param a: @param b: @return: .. py:function:: read_csv(path) -> Union[None, pandas.DataFrame] Path leads a folder containing embeddings in csv format. indexes correspond subjects or predicates or objects in n-triple. @param path: @return: .. py:function:: assertion_path_isfile(path) -> bool .. py:function:: sanity_checking_args(args) .. py:function:: read_individuals_file(file: str) -> Set[owlapy.owl_individual.OWLNamedIndividual] Read a text file containing IRIs of Named Individuals (one per line) and return the content as a set of OWL Named Individuals :param file: path to the text file with the IRIs of the named individuals :returns: set of OWLNamedIndividual with these IRIs .. py:function:: read_named_classes_file(file: str) -> Set[owlapy.class_expression.OWLClass] Read a text file containing IRIs of OWL Named Classes (one per line) and return the content as a set of OWL Classes :param file: path to the text file with the IRIs of the classes :returns: set of OWLNamedIndividual with these IRIs