recbole.data.social_dataset¶
Bases:
recbole.data.dataset.dataset.Dataset
SocialDataset
is based onDataset
, and load.net
additionally.It also provides several interfaces to transfer
.net
features into coo sparse matrix, csr sparse matrix,DGL.Graph
orPyG.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] = 1
ifvalue_field
isNone
, elsegraph[src, tgt] = self.net_feat[value_field][src, tgt]
.Currently, we support graph in DGL and PyG, and two type of sparse matrixes,
coo
andcsr
.- 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.