Skip to main content

spartan2:

spartan2 is a collection of data mining algorithms on big graphs and time series, as graphs and time series are fundamental representations of many key applications in a wide range of users' online behaviors (e.g. social media, shopping, Apps), finance (e.g. stock tradings, bank transfers), IoT networks (e.g. sensor readings, smart power grid), and healthcare (e.g. electrocardiogram, photoplethysmogram, respiratory inductance plethysmography).

In practice, we find that thinking graphs and time series as matrices or tensors can enable us to find efficient (near linear), interpretable, yet accurate solutions in many applications.

Therefore, we want to develop a collectioin of algorithms on graphs and time series based on tensors (matrix is a 2-mode tensor). In real world, those tensors are sparse, and we are required to make use of the sparsity to develop efficient algorithms. That is why we name the package of algorithms as

SparTAn: Sparse Tensor Analytics.

spartan2 is backend of SparTAn. Everything here is viewed as a tensor (sparse).

install requires

This project requires Python 3.7 and upper. We suggest recreating the experimental environment using Anaconda through the following steps.

  1. Install the appropriate version for Anaconda from here - https://www.anaconda.com/distribution/

  2. Create a new conda environment named "spartan"

conda create -n spartan python=3.7
conda activate spartan
  1. If you are a normal USER, download the package from pip
pip install spartan2
  1. If you are a DEVELOPER and want to contribute to the project, please
  • clone the project from github
git clone https://github.com/shenghua-liu/spartan2.git
  • Install requirements.
# [not recommended]# pip install --user --requirement requirements
# using conda tool
conda install --force-reinstall -y --name spartan -c conda-forge --file requirements

or

# this may not work in ubuntu 18.04
python setup.py install
  • Install code in development mode
# in parent directory of spartan2
pip install -e spartan2
  • Since you install your package to a location other than the user site-packages directory, you will need to add environment variable PYTHONPATH in ~/.bashrc
export PYTHONPATH=/<dir to spartan2>/spartan2:$PYTHONPATH

or prepend the path to that directory to your PYTHONPATH environment variable.

import sys
sys.path.append("/<dir to spartan2>/spartan2")

or

#find directory of site-packages
python -c 'import site; print(site.getsitepackages())'

and add <name>.pth file in your site-packages directory

/<dir to spartan2>/spartan2
  1. run the project demos in jupyter notebook:
  • start jupyter notebook
  • click to see each jupyter notebook (xxx.ipynb) demo for each algorithm, or see the following guidline.

In the future, docs of code can be read from readthedocs.

Live-tutorials: Table of Contents

All contents are collected in another repository spartan-tutorials, you can clone that repository to get all the notebooks and example data to run on your own.

Part 1: Basic

Part 2: Big Graphs

Part 3: Time Series

References

  1. Shenghua Liu, Bryan Hooi, Christos Faloutsos, A Contrast Metric for Fraud Detection in Rich Graphs, IEEE Transactions on Knowledge and Data Engineering (TKDE), Vol 31, Issue 12, Dec. 1 2019, pp. 2235-2248.
  2. Shenghua Liu, Bryan Hooi, and Christos Faloutsos, "HoloScope: Topology-and-Spike Aware Fraud Detection," In Proc. of ACM International Conference on Information and Knowledge Management (CIKM), Singapore, 2017, pp.1539-1548.
  3. Prakash, B. Aditya, Ashwin Sridharan, Mukund Seshadri, Sridhar Machiraju, and Christos Faloutsos. "Eigenspokes: Surprising patterns and scalable community chipping in large graphs." In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 435-448. Springer, Berlin, Heidelberg, 2010.
  4. Wenjie Feng, Shenghua Liu, Christos Faloutsos, Bryan Hooi, Huawei Shen, Xueqi Cheng, EagleMine: Vision-Guided Mining in Large Graphs, ACM SIGKDD 2018, ODD Workshop on Outlier Detection De-constructed, August 20th, London UK.
  5. Bryan Hooi, Shenghua Liu, Asim Smailagic, and Christos Faloutsos, “BEATLEX: Summarizing and Forecasting Time Series with Patterns,” The European Conference on Machine Learning & Principles and Practice of Knowledge Discovery in Databases (ECML-PKDD), Skopje, Macedonia, 2017.
  6. Hooi, Bryan, Hyun Ah Song, Alex Beutel, Neil Shah, Kijung Shin, and Christos Faloutsos. "Fraudar: Bounding graph fraud in the face of camouflage." In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 895-904. 2016.
  7. Zhou, Bin, Shenghua Liu, Bryan Hooi, Xueqi Cheng, and Jing Ye. "BeatGAN: Anomalous Rhythm Detection using Adversarially Generated Time Series." In IJCAI, pp. 4433-4439. 2019.

Release files for spartan2 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spartan2 0.0.2
File Size Uploaded
spartan2-0.0.2.tar.gz 126.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spartan2 0.0.2
File Interpreter ABI Platform
spartan2-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 291.3 kB

Release files / spartan2-0.0.2.tar.gz

Download URL spartan2-0.0.2.tar.gz
Size 126.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7d462ff31e7c1f02a44ebb229ae5d8a4de4ab1bff2fe870a31be518323e56516
BLAKE2b-256 checksum
How to use checksums
9818361e49d486a8a0578d19cece538595760e64317db51ac4026adc4f25eb4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.4

Release files / spartan2-0.0.2-py3-none-any.whl

Download URL spartan2-0.0.2-py3-none-any.whl
Size 164.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a808a7a9655eea86c9afac1e3e056c40bd52b996d70e5de5cf255cc973f8355e
BLAKE2b-256 checksum
How to use checksums
14e0a388a3b88bf094d9705326d93cfbb20e345fece0bc21d01607fc08bb2bcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.4

Release history Release notifications | RSS feed

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page