Skip to main content

Mercury Reels

Python 3.10 Python 3.11 Python 3.12 Python 3.13 Apache 2 license 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

How to setup a development environment and contribute to reels

See DEVELOPMENT

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

Release files for mercury-reels 1.6.3

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

Source distribution (sdist)

Source distribution for mercury-reels 1.6.3
File Size Uploaded
mercury_reels-1.6.3.tar.gz 1.2 MB Details

Release files / mercury_reels-1.6.3.tar.gz

Download URL mercury_reels-1.6.3.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b1ff948058614290b28d124da300d11d3c4d5828df665decd16ffcc637ceeb08
BLAKE2b-256 checksum
How to use checksums
5101cb180cbb02dc0e868f6557225341b18b1ca681a7152c16a8d0731f0d8aec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.6.3 This release

1 release file

1.5.1

1 release file

1.4.5

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

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