py3plex.algorithms.hedwig.learners package

Submodules

py3plex.algorithms.hedwig.learners.bottomup module

Main learner class.

@author: anze.vavpetic@ijs.si

class py3plex.algorithms.hedwig.learners.bottomup.BottomUpLearner(kb, n=None, min_sup=1, sim=1, depth=4, target=None, use_negations=False)

Bases: object

Bottom-up learner.

Default = 'default'
Improvement = 'improvement'
Similarity = 'similarity'
bottom_clause()
get_subclasses(pred)
get_superclasses(pred)
induce()

Induces rules for the given knowledge base.

is_implicit_root(pred)

py3plex.algorithms.hedwig.learners.learner module

Main learner class.

@author: anze.vavpetic@ijs.si

class py3plex.algorithms.hedwig.learners.learner.Learner(kb, n=None, min_sup=1, sim=1, depth=4, target=None, use_negations=False, optimal_subclass=False)

Bases: object

Learner class, supporting various types of induction from the knowledge base.

Default = 'default'
Improvement = 'improvement'
Similarity = 'similarity'
can_specialize(rule)

Is the rule good enough to be further refined?

extend(rules, specializations)

Extends the ruleset in the given way.

extend_replace_worst(rules, specializations)

Extends the list by replacing the worst rules.

extend_with_similarity(rules, specializations)

Extends the list based on how similar is ‘new_rule’ to the rules contained in ‘rules’.

get_subclasses(pred)
get_superclasses(pred)
group_score(rules)

Calculates the score of the whole list of rules.

induce()

Induces rules for the given knowledge base.

is_implicit_root(pred)
non_redundant(rule, new_rule)

Is the rule non-redundant compared to its immediate generalization?

specialize(rule)

Returns a list of all specializations of ‘rule’.

specialize_add_relation(rule)

Specialize with new binary relation.

py3plex.algorithms.hedwig.learners.optimal module

Main learner class.

@author: anze.vavpetic@ijs.si

class py3plex.algorithms.hedwig.learners.optimal.OptimalLearner(kb, n=None, min_sup=1, sim=1, depth=4, target=None, use_negations=False, optimal_subclass=True)

Bases: py3plex.algorithms.hedwig.learners.learner.Learner

Finds the optimal top-k rules.

induce()

Induces rules for the given knowledge base.

Module contents

py3plex.algorithms.hedwig.learners.HeuristicLearner

alias of py3plex.algorithms.hedwig.learners.learner.Learner

class py3plex.algorithms.hedwig.learners.OptimalLearner(kb, n=None, min_sup=1, sim=1, depth=4, target=None, use_negations=False, optimal_subclass=True)

Bases: py3plex.algorithms.hedwig.learners.learner.Learner

Finds the optimal top-k rules.

induce()

Induces rules for the given knowledge base.