ontolearn.binders
Pyhon binders of other concept learners.
Classes
dl-learner python binder. |
Module Contents
- class ontolearn.binders.DLLearnerBinder(binary_path=None, model=None, kb_path=None, storage_path='.', max_runtime=3)[source]
dl-learner python binder.
- binary_path
- kb_path
- name
- max_runtime
- best_predictions = None
- config_name_identifier = None
- write_dl_learner_config(pos: List[str], neg: List[str], use_sparql=False) str [source]
Writes config file for dl-learner.
- Parameters:
pos – A list of URIs of individuals indicating positive examples in concept learning problem.
neg – A list of URIs of individuals indicating negatives examples in concept learning problem.
- Returns:
Path of generated config file.
- Return type:
str
- fit(lp: PosNegLPStandard, max_runtime: int = None, use_sparql=False)[source]
Fit dl-learner model on a given positive and negative examples.
- Parameters:
lp – PosNegLPStandard
problem. (lp.neg A list of URIs of individuals indicating negatives examples in concept learning)
problem.
max_runtime – Limit to stop the algorithm after n seconds.
- Returns:
self.
- best_hypotheses(n: int = None) PredictedConcept [source]
- best_hypothesis()[source]
Return predictions if exists.
- Returns:
The prediction or the string ‘No prediction found.’
- parse_dl_learner_output(output_of_dl_learner: List[str], file_path: str) Dict [source]
Parse the output received from executing dl-learner.
- Parameters:
output_of_dl_learner – The output of dl-learner to parse.
file_path – The file path to store the output.
- Returns:
…, ‘Accuracy’: …, ‘F-measure’: …}.
- Return type:
A dictionary of {‘Prediction’
- abstract fit_from_iterable(dataset: List = None, max_runtime=None) List[Dict] [source]
Fit dl-learner model on a list of given positive and negative examples.
- Parameters:
dataset – A list of tuple (s,p,n) where s => string representation of target concept, p => positive examples, i.e. s(p)=1 and n => negative examples, i.e. s(n)=0.
max_runtime – Limit to stop the algorithm after n seconds.
- Returns:
self.