- get_relation_pattern_types_df(dataset, *, min_support=0, min_confidence=0.95, drop_confidence=False, parts=None, force=False, add_labels=True)
Categorize relations based on patterns from RotatE [sun2019].
The relation classifications are based upon checking whether the corresponding rules hold with sufficient support and confidence. By default, we do not require a minimum support, however, a relatively high confidence.
The following four non-exclusive classes for relations are considered:
This method generally follows the terminology of association rule mining. The patterns are expressed as\[X_1 \land \cdot \land X_k \implies Y\]
where \(X_i\) is of the form \(r_i(h_i, t_i)\), and some of the \(h_i / t_i\) might re-occur in other atoms. The support of a pattern is the number of distinct instantiations of all variables for the left hand side. The confidence is the proportion of these instantiations where the right-hand side is also true.
Dataset) – The dataset to investigate.
int) – A minimum support for patterns.
float) – A minimum confidence for the tested patterns.
bool) – Whether to drop the support/confidence information from the result frame, and also drop duplicates.
bool) – Whether to enforce re-calculation even if a cached version is available.
bool) – Whether to add relation labels (if available).
- Return type
If you intend to use the relation categorization as input to your model, or hyper-parameter selection, do not include testing triples to avoid leakage!