load_ppi5k¶
-
ampligraph.datasets.load_ppi5k(check_md5hash=False, clean_unseen=True, split_test_into_top_bottom=True, split_threshold=0.1)¶ Load the PPI5K dataset
Originally proposed in [CCS+19], PPI5K is a subset of the protein-protein interactions (PPI) knowledge graph [SM+16]. Numeric values represent the confidence of the link based on existing scientific literature evidence.
PPI5K is loaded from file if it exists at the
AMPLIGRAPH_DATA_HOMElocation. IfAMPLIGRAPH_DATA_HOMEis not set the the default~/ampligraph_datasetsis checked.If the dataset is not found at either location, it is downloaded and placed in
AMPLIGRAPH_DATA_HOMEor~/ampligraph_datasets.It is divided into three splits:
trainvalidtest
Each triple in these splits is associated to a numeric value which models additional information on the fact (importance, relevance of the link).
Dataset Train Valid Test Entities Relations PPI5K 230929 19017 21720 4999 7 Parameters: - check_md5hash (boolean) – If
Truecheck the md5hash of the files. Defaults toFalse. - clean_unseen (bool) – If
True, filters triples in validation and test sets that include entities not present in the training set. - split_test_into_top_bottom (bool) – When set to
True, the function also returns subsets of the test set that includes only the top-k or bottom-k numeric-enriched triples. splitstest_topk,test_bottomkand their numeric values. Such splits are generated by sorting Splits the test set by numeric values and returns test_top_split and test_bottom_split by splitting based on sorted numeric values and returning top and bottom k% triples, where ‘k’ is specified by thesplit_thresholdargument. - split_threshold (float) – specifies the top and bottom percentage of triples to return
Returns: splits – The dataset splits: {‘train’: train, ‘valid’: valid, ‘test’: test, ‘test_topk’: test_topk, ‘test_bottomk’: test_bottomk, ‘train_numeric_values’: train_numeric_values, ‘valid_numeric_values’:valid_numeric_values, ‘test_numeric_values’: test_numeric_values, ‘test_topk_numeric_values’: test_topk_numeric_values, ‘test_bottomk_numeric_values’: test_bottomk_numeric_values}.
Each
*_numeric_valuessplit contains numeric values associated to the corresponding dataset split and is a ndarray of shape [n].Each dataset split is a ndarray of shape [n,3].
The
*_topkand*_bottomksplits are only returned whensplit_test_into_top_bottom=True.Return type: dict
Examples
>>> from ampligraph.datasets import load_ppi5k >>> X = load_ppi5k()