Skip to main content

Reels helps identify patterns in event data and can predict target events.

Project description

Mercury Reels

Build Status Python 3.8 Python 3.9 Python 3.10 Python 3.11 Apache 2 license codecov Ask Me Anything !

What is this?

TLDR: Reels helps identify patterns in event data and can predict target events.

Reels is a library to analyze sequences of events extracted from transactional data. These events can be automatically discovered or manually defined. Reels identifies events by assigning them event codes and creates clips, which are sequences of (code, time of occurrence) tuples for each client. Using these clips, a model can be generated to predict the time at which target events may occur in the future.

What problems is REELS good for?

Reels was born to analyze web navigation transactional data. It has natural applications in cybersecurity and everywhere where predicting events or scoring risk of events based on past events makes sense. The definition of relevant event may be discovered from transactional data or is established as business domain knowledge. It can also be semi-automated using Reels event optimizer to iterate and learn how events predict a target.

What data size can reels tackle?

Reels is a C++ implementation with a Python interface. It is single threaded and can seamlessly operate over millions of clients and billions of records with hundreds of thousands of events. To further parallelize, it can partition the data by dividing the set of clients into smaller subsets and operate on each subset independently.

I already have time series and sequence prediction tools, why would I need another one?

  • Reels is oriented towards events (as opposed to continuous variables like a price).
  • Even when your problem is better seen as time series, Reels predictions can be used as features to boost another model.
  • Supports manual, full automatic or assisted definition of what relevant (predictive) events are.
  • Predicts a target event within or outside the transactional dataset.
  • Highly efficient C++ implementation.
  • 100% pythonic interface: objects are serializable, use iterators, interfaces with pandas and pyspark.

The Python API

Reels is implemented in four classes.

The Events class

The Clients class

The Clips class

The Targets class

Try it without any installation on Google Colab

  • Introductory: A walk through Reels Open In Colab
  • Advanced: Event optimization -- How to do assisted event discovery Open In Colab

Install

pip install mercury-reels

Clone and set up a development environment to work with it

To work with Reels command line or develop Reels, you can set up an environment with git, gcc, make and the following tools:

  • catch2 (Already included in source code)
  • doxygen 1.9.5 or better (to render C++ documentation)
  • mkdocs 1.4.2 or better (to render Python documentation)
  • swig 4.0.2
  • python 3.x with appropriate paths to python.h (see Makefile)
git clone https://github.com/BBVA/mercury-reels.git
cd mercury-reels/src

make

Make without arguments gives help. Try all the options. Everything should work assuming the tools are installed.

Documentation

License

                         Apache License
                   Version 2.0, January 2004
                http://www.apache.org/licenses/

     Copyright 2022-23, Banco de Bilbao Vizcaya Argentaria, S.A.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mercury-reels-1.4.2.tar.gz (131.8 kB view details)

Uploaded Source

File details

Details for the file mercury-reels-1.4.2.tar.gz.

File metadata

  • Download URL: mercury-reels-1.4.2.tar.gz
  • Upload date:
  • Size: 131.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for mercury-reels-1.4.2.tar.gz
Algorithm Hash digest
SHA256 c735bcb58531c9a6bad12297780a44767ff7328025c2a7e572fc9d5ddcd84524
MD5 9c4a7321c4f2da7344ec4d78532f6f8d
BLAKE2b-256 6ce6fbb815a79181970cc763143b7aa5babdcf4d1041f90937f041ed58f65242

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page