Input and Output¶
Entry points for PyKEEN.
PyKEEN is a machine learning library for knowledge graph embeddings that supports node clustering,
link prediction, entity disambiguation, question/answering, and other tasks with knowledge graphs.
It provides an interface for registering plugins using Python’s entrypoints under the
pykeen.triples.prefix_importer groups. More specific
information about how the Bio2BEL plugin is loaded into PyKEEN can be found in Bio2BEL’s
setup.cfg under the
The following example shows how you can parse/load the triples from a Bio2BEL
repository using the
# Example 1A: Make triples factory from pykeen.triples import TriplesFactory tf = TriplesFactory(path='bio2bel:mirtarbase') # Example 1B: Use directly in the pipeline, which automatically invokes training/testing set stratification from pykeen.pipeline import pipeline results = pipeline( dataset='bio2bel:mirtarbase', model='TransE', )
Automation of installation and execution of Bio2BEL packages.
ensure_tsv(name, *, manager_kwargs=None)¶
Generate/save a TSV from the Bio2BEL package using
pybel.to_tsv()and return its path.
The resulting file is cached within the bio2bel package’s data directory. If it already exists, the path is directly returned with no other code being run.
ensure_graph(name, *, manager_kwargs=None)¶
Generate, cache, and return the BEL graph for a given Bio2BEL package.
If it has already been cached, it is loaded directly.