plot_er(pipeline_result, *, model=None, entities=None, relations=None, apply_limits=True, margin=0.4, plot_entities=True, plot_relations=None, annotation_x_offset=0.02, annotation_y_offset=0.03, ax=None, **kwargs)[source]

Plot the reduced entities and relation vectors in 2D.

  • pipeline_result – The result returned by pykeen.pipeline.pipeline().

  • model (Optional[str]) – The dimensionality reduction model from sklearn. Defaults to PCA. Can also use KPCA, GRP, SRP, TSNE, LLE, ISOMAP, MDS, or SE.

  • entities (Optional[Set[str]]) – A subset of entities to plot

  • relations (Optional[Set[str]]) – A subset of relations to plot

  • apply_limits (bool) – Should the x and y limits be applied?

  • margin (float) – The margin size around the minimum/maximum x and y values

  • plot_entities (bool) – If true, plot the entities based on their reduced embeddings

  • plot_relations (Optional[bool]) – By default, this is only enabled on translational distance models like pykeen.models.TransE.

  • annotation_x_offset (float) – X offset of label from entity position

  • annotation_y_offset (float) – Y offset of label from entity position

  • ax – The matplotlib axis, if pre-defined

  • kwargs – The keyword arguments passed to __init__() of the reducer class (e.g., PCA, TSNE)


The axis


ValueError – if entity plotting and relation plotting are both turned off


Plotting relations and entities on the same plot is only meaningful for translational distance models like TransE.