Skip to content
Go implementation of MIDAS: Microcluster-Based Detector of Anomalies in Edge Streams
Go
Branch: master
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples First commit Apr 28, 2020
.gitignore
LICENSE.txt
README.md
edgehash.go First commit Apr 28, 2020
edgehash_test.go
midas.go Add README examples and expose MidasModel struct Apr 29, 2020
midasr.go Add Fit and FitPredict api for MidasR struct May 7, 2020
nodehash.go First commit Apr 28, 2020
nodehash_test.go

README.md

MIDAS

This is an implementation of MIDAS - edge stream anomaly detection but implemented in Go.

For more information about how it works, please checkout the resources section.

Usage and installation

Read the docs

Checkout the examples folder for detailed instructions

import (
	"github.com/steve0hh/midas"
	"fmt"
)

func main () {
	src := []int{2,2,3,3,5,5,7,11,1,2}
	dst := []int{3,3,4,4,9,9,73,74,75,76}
	times := []int{1,1,2,2,2,2,2,2,2,2}


	// using function to score the edges
	midasAnormScore := midas.Midas(src, dst, times, 2, 769)
	midasRAnormScore := midas.MidasR(src, dst, times, 2, 769, 0.6)

	fmt.Println(midasAnormScore)
	fmt.Println(midasRAnormScore)

	// using sklearn FitPredict api for midas
	m := midas.NewMidasModel(2, 769, 9460)
	fmt.Println(m.FitPredict(2,3,1))
	fmt.Println(m.FitPredict(2,3,1))
	fmt.Println(m.FitPredict(3,4,2))

	// using sklearn FitPredict api for midasR
	mr := midas.NewMidasRModel(2, 769, 9460, 0.6)
	fmt.Println(mr.FitPredict(2,3,1))
	fmt.Println(mr.FitPredict(2,3,1))
	fmt.Println(mr.FitPredict(3,4,2))
}

Resources

Citation

If you use this code for your research, please consider citing the original paper.

@article{bhatia2019midas,
  title={MIDAS: Microcluster-Based Detector of Anomalies in Edge Streams},
  author={Bhatia, Siddharth and Hooi, Bryan and Yoon, Minji and Shin, Kijung and Faloutsos, Christos},
  journal={arXiv preprint arXiv:1911.04464},
  year={2019}
}

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

  • Report bugs
  • Fix bugs and submit pull requests
  • Write, clarify, or fix documentation
  • Suggest or add new features

TODOs

  • Godocs documentation
  • Add sklearn/keras fit & predict API
  • More examples and tests
  • Make code more efficient
You can’t perform that action at this time.