# get_relation_pattern_types_df

get_relation_pattern_types_df(dataset, *, min_support=0, min_confidence=0.95, drop_confidence=False, parts=None, force=False, add_labels=True)[source]

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:

• symmetry

• anti-symmetry

• inversion

• composition

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.

Parameters:
Return type:

DataFrame

Warning

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!

Return type:

DataFrame

Returns:

A dataframe with columns {“relation_id”, “pattern”, “support”?, “confidence”?}.

Parameters: