Giter Club home page Giter Club logo

anomrank-py's Introduction

Hello!

I'm Gabriel, a Romanian software developer with a passion for open source software.

You can find a summary of my most popular projects and my recent activity below.

anomrank-py's People

Contributors

bogdannitica99 avatar dependabot[bot] avatar gabrielmajeri avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

anomrank-py's Issues

Port `main.cpp`

Need to convert main.cpp to Python. The main function reads the sample dataset and then runs the anomaly detection algorithm on it, reporting the accuracy.

Port `read_data` to Python

To improve the performance of data loading, we should try to port the read_data function to Rust, which will run a lot faster (since it doesn't have to allocate so many small objects). This issue outlines how we could do it.

From a code perspective:

  • Open and read the file indicated by the given path (up to the limit of rows we're told to read).
  • Create a new Rust structure for storing each TimeEdge.
  • Store the edges in a vector.
  • Perform the operations the existing Python code does (find min/max of node indices, subtract them, etc.)
  • Convert the result to numpy format using rust-numpy and then return it back to Python.

Besides the code, we should also:

  • convert the Python docstring to Rust doc comments, which will be automatically converted to docstrings by pyo3
  • port the unit tests to Rust

Set up automated tests

To ensure the code works, we should create a unit and integration test suite, automated with pytest.

Initially, we could keep tests alongside the library code.

The layout would be:

anomrank/
 - __init__.py
 - anomaly_detect.py
 - read_data.py
 - test/
    - __init__.py
    - test_anomaly_detect.py
    - test_read_data.py
    - data.txt
  • test_anomaly_detect.py: runs the functions in anomaly_detect.py
  • test_read_data.py: runs the functions in read_data.py.
  • data.txt: small file in which we place some values for the read_data function

Port `read_data.cpp`

The read_data function reads into memory the list of edges, with their corresponding time stamps.

Port original code to Python

I've forked the original code and updated it to use modern C++ features in this repo.

Details

Need to convert the C++ files from here to Python code.

Components

  • main

  • read_data

  • PageRank

  • accuracy

  • anomaly_detect

  • anomaly_inject

Port `anomaly_inject.cpp`

The function inject adds a new edge on the graph between two nodes. inject_anomaly adds an anomaly to the graph and inject_snapshot adds the current state of the graph.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.