recbole.data.social_dataset¶
Bases:
recbole.data.dataset.dataset.DatasetSocialDatasetis based onDataset, and load.netadditionally.It also provides several interfaces to transfer
.netfeatures into coo sparse matrix, csr sparse matrix,DGL.GraphorPyG.Data.The same as
config['SOURCE_ID_FIELD'].- Type
str
The same as
config['TARGET_ID_FIELD'].- Type
str
Internal data structure stores the network features. It’s loaded from file
.net.- Type
pandas.DataFrame
Get graph or sparse matrix that describe relations between users.
For an edge of <src, tgt>,
graph[src, tgt] = 1ifvalue_fieldisNone, elsegraph[src, tgt] = self.net_feat[value_field][src, tgt].Currently, we support graph in DGL and PyG, and two type of sparse matrices,
cooandcsr.- Parameters
form (str, optional) – Format of sparse matrix, or library of graph data structure. Defaults to
coo.value_field (str, optional) – edge attributes of graph, or data of sparse matrix, Defaults to
None.
- Returns
Graph / Sparse matrix of relations.