ontolearn.experiments

Experiments to validate a concept learning model.

Module Contents

Classes

Experiments

class ontolearn.experiments.Experiments(max_test_time_per_concept=3)[source]
static store_report(model, learning_problems: List[Iterable], test_report: List[dict]) Tuple[str, Dict[str, Any]][source]

Create a report for concepts generated for a particular learning problem. :param model: Concept learner. :param learning_problems: A list of learning problems (lps) where lp corresponds to target concept, positive and

negative examples, respectively.

Parameters:

test_report – A list of predictions (preds) where test_report => { ‘Prediction’: str, ‘F-measure’: float, ‘Accuracy’, ‘Runtime’:float}.

Returns:

Both report as string and report as dictionary.

start_KFold(k=None, dataset: List[Tuple[str, Set, Set]] = None, models: Iterable = None)[source]

Perform KFold cross validation.

Parameters:
  • models – concept learners.

  • k – k value of k-fold.

  • dataset – A list of tuples where a tuple (i,j,k) where i denotes the target concept j denotes the set of positive examples and k denotes the set of negative examples.

Note

This method returns nothing. It just prints the report results.

start(dataset: List[Tuple[str, Set, Set]] = None, models: List = None)[source]
static report_results(results, num_problems)[source]

Prints the result generated from validations.