大图和时间序列分析工具集Spartan2——Dense subgraph检测实践

大图和时间序列分析工具集—Spartan2

先上Github链接!!!:Welcome to spartan2

1 简介

大图和时间序列是用户在线行为(例如社交媒体、购物、应用程序)、金融(例如股票交易、银行转账)、物联网网络(例如传感器读数、智能电网)和医疗保健(例如心电图、 光体积描记、呼吸电感体积描记)等领域的表示。

Spartan2 是关于大图和时间序列数据挖掘算法的集合,可用于高效地解决三个基本任务:异常检测、预测和汇总,由中科院计算所团队开发。

2 安装(常见问题解决)

2.1 Spartan2安装具体请看 Welcome to spartan2READMA步骤

在这里插入图片描述

2.2 常见问题

  • Microsoft Visual C++ 14.0 is required在这里插入图片描述

  • spyder 4.0.1 requires xxxx
    在这里插入图片描述
    解决办法:pip install xxxx,如第三行:pip install jedi == 0.14.1

  • Cannot uninstall ‘llvmlite’在这里插入图片描述
    解决办法:进入anaconda3→Lib→site-packages-site-packages,找到llvmlite-0.23.1-py3.6.egg-info,直接删掉

3 Dense subgraph检测实践

在大图中进行Dense subgraph检测的算法有Fraudar、HoloScope、EigenSpokes等,下面根据Spartan2中的live-tutorials应用EigenPulse算法进行实验

3.1 EigenPulse

一种实时检测滑动窗口激增的流算法

3.1 Abstract

Spartan2提出了一个带有滑动窗口的行增广矩阵来对流图进行建模,并设计了 AugSVD 算法以进行计算和内存高效的奇异分解

3.2 Code

用到的相关数据在spartan2中有:spartan2-tutorials

import spartan as st
import gzip
f = gzip.open("./Desktop/Spartan2_Data/test_beer.tensor.gz")
Function loadTensorStream()
tensor_stream = st.TensorStream(f, col_idx = [0,1,2,3], col_types=[int,int,int,int], sep=',', mappers={},hasvalue=True)
Run EigenPulse as a single model
param_dict={'window':20, 'stride':10, 'l':20, 'b':10,'item_idx':1,'ts_idx':2}
eigenpulse = st.EigenPulse(tensor_stream, **param_dict)
res, densities = eigenpulse.run()

out:
在这里插入图片描述

st.drawEigenPulse(densities)

out:
在这里插入图片描述

Run EigenPulse from anomaly detection task
f = gzip.open("./Desktop/Spartan2_Data/test_beer.tensor.gz")
tensor_stream = st.TensorStream(f, col_idx = [0,1,2,3], col_types=[int,int,int,int], sep=',', mappers={},hasvalue=True)

ad_model = st.AnomalyDetection.create(tensor_stream, st.ADPolicy.EigenPulse, 'eigenpulse',**param_dict)

res, densities = ad_model.run()

out:
在这里插入图片描述

3.2 Fraudar

FRAUDAR is an algorithm for catching fraudulent blocks in graph datasets (e.g. a review graph, Twitter follow graph, etc.) in a camouflage-resistant way.

Spartan 链接:spartan2-tutorials/Fraudar

3.3 Holoscope

HoloScope is topology-and-spike aware fraud detection. HoloScope detect a subgraph of highly constrast suspicousness on topological, temporal, and categorical (e.g. rating score, topic, tag) infomation.

Spartan 链接:spartan2-tutorials/Holoscope

End

Welcome to spartan2中还有很多高效的大图和时间序列数据挖掘算法,可以收藏(Fork)(✪ω✪)

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值