SkillAgentSearch skills...

Spartan2

A collection of data mining algorithms on big graphs and time series

Install / Use

/learn @stair-team/Spartan2
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Welcome to spartan2

Introduction

spartan2 is a collection of data mining algorithms on big graphs and time series, providing three basic tasks: anomaly detection, forecast, and summarization. (see readthedocs, and tutorials )

Graphs and time series are fundamental representations of many key applications in a wide range of

  • online user behaviors, e.g. following in social media, shopping, and downloading Apps,
  • finance, e.g. stock tradings, and bank transfers,
  • sensor networks, e.g. sensor readings, and smart power grid, and
  • health, e.g. electrocardiogram, photoplethysmogram, and 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, our goal is developping 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 as spartan: sparse tensor analytics.

The package named spartan can be imported and run independently as a usual python package. Everything in package spartan is viewed as a tensor (sparse).

Install requirements

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
    
  3. If you are a normal USER,

    # install spartan using pip
    pip install spartan2
    
  4. If you want to contribute, or prefer to run directly on the code,

    <details> <summary>Please do the following setup</summary>
    • 4.1 Clone the project from github

      git clone git@github.com:BGT-M/spartan2.git
      
    • 4.2 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 use the following way

      # this may not work in ubuntu 18.04
      python setup.py install
      
    • 4.3 Install code in development mode

      # in parent directory of spartan2
      pip install -e spartan2
      
    • 4.4 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 do as follows

      #find directory of site-packages
      python -c 'import site; print(site.getsitepackages())'
      
      #add \<name\>.pth file in your site-packages directory with string '/<dir to spartan2>/spartan2'
      
      
    </details>

Table of Modules

| Type | Abbr | Paper | Year | Tutorials | | :---------- | :----------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------- | :--------------------------------------------------------------------------------------- | | Graph | spartan.HoloScope | [1] HoloScope: Topology-and-Spike Aware Fraud Detection [pdf] [bib]<br>[2] A Contrast Metric for Fraud Detection in Rich Graphs [pdf] [bib] | 2017<br>2019 | HoloScope | | Graph | spartan.Eigenspokes | [3] Eigenspokes: Surprising patterns and scalable community chipping in large graphs [pdf] [bib] | 2010 | Eigenspokes | | Graph | spartan.EagleMine | [4] EagleMine: Vision-guided Micro-clusters recognition and collective anomaly detection [pdf] [bib] <br> Beyond outliers and on to micro-clusters: Vision-guided anomaly detection [pdf] [bib] | 202

View on GitHub
GitHub Stars95
CategoryDevelopment
Updated3d ago
Forks22

Languages

Python

Security Score

100/100

Audited on Mar 28, 2026

No findings