比特币场外交易数据集

class dgl.data.BitcoinOTCDataset(raw_dir=None, force_reload=False, verbose=False, transform=None)[source]

Bases: DGLBuiltinDataset

用于欺诈检测的BitcoinOTC数据集

这是一个关于在名为Bitcoin OTC的平台上使用比特币进行交易的人之间的信任网络。由于比特币用户是匿名的,因此需要维护用户声誉记录,以防止与欺诈和高风险用户进行交易。

官方网站: https://snap.stanford.edu/data/soc-sign-bitcoin-otc.html

比特币OTC数据集统计:

  • 节点数:5,881

  • 边数: 35,592

  • 边权重范围:-10 到 +10

  • 正边百分比:89%

Parameters:
  • raw_dir (str) – Raw file directory to download/contains the input data directory. Default: ~/.dgl/

  • force_reload (bool) – Whether to reload the dataset. Default: False

  • verbose (bool) – Whether to print out progress information. Default: True.

  • transform (callable, optional) – A transform that takes in a DGLGraph object and returns a transformed version. The DGLGraph object will be transformed before every access.

graphs

DGLGraph对象的列表

Type:

list

is_temporal

指示图表是否为时间图表

Type:

bool

Raises:

UserWarning – 如果作者在远程服务器上更改了原始数据。

示例

>>> dataset = BitcoinOTCDataset()
>>> len(dataset)
136
>>> for g in dataset:
....    # get edge feature
....    edge_weights = g.edata['h']
....    # your code here
>>>
__getitem__(item)[source]

通过索引获取图表

Parameters:

项目 (int) – 项目索引

Returns:

图表包含:

  • edata['h'] : 边权重

Return type:

dgl.DGLGraph

__len__()[source]

数据集中的图表数量。

Return type:

int