We’re excited to announce that our new installation method of installing MLFinlab, which utilizes Docker, is now available in open beta.

Our foundational offering, MLFinLab, is a shining beacon of our dedication, encapsulating an advanced Python library flush with production-grade algorithms plucked from prestigious academic journals and progressive textbooks. Designed for discerning portfolio managers and traders, it offers an unparalleled suite of intuitive, interpretable, and actionable tools.

We previously announced the closed beta phase for our Dockerized version of MLFinLab, aiming to make the MLFinLab experience even smoother. Today, we’re taking another major step forward.

The beta is now open to all subscribers

We’re thrilled to announce that the Docker for MLFinLab beta is now open to everyone with a valid MLFinLab subscription. Our aim has always been to deliver top-notch service, and in line with that, we want to expand the Dockerized experience to our larger community.

Why Docker? A quick refresher 🐳

Python, while robust, sometimes presents the challenges of dependency management, famously known as the “Python dependency hell”. With the Dockerized version of MLFinLab, you’re empowered to bypass these challenges. Docker ensures that MLFinLab and all its requisite dependencies are wrapped into a consistent, deployable unit. This not only ensures cross-platform consistency but also guarantees a hassle-free user experience, devoid of conflicts and system-specific quirks.

What to expect from this experience?

Gone are the days of manually configuring Python environments and wrestling with pip installations. The Dockerized MLFinLab is all about automation and simplicity:

  1. Pull: Retrieve a Docker image replete with every dependency you’ll need.
  2. Authenticate: As the container springs to life, your API key is validated.
  3. Initiate: MLFinLab is installed effortlessly within the container.
  4. Launch: Dive straight into a ready-to-use Jupyter Lab or Notebook instance.

Best of all, these steps are automatically taken care of for you with our mlfinlab-quickstart project, which gets you up and running with the Dockerized version of MLFinlab in a matter of seconds.

This entire operation is neatly compartmentalized within the Docker container, ensuring zero interference with your main system. It’s an evolved, streamlined approach to MLFinLab installation that we’re confident you’ll appreciate.

Your role in this journey

By opening the beta to our subscribers, we’re emphasizing our belief in community-driven development. Your feedback and insights will be foundational in shaping the Dockerized MLFinLab’s trajectory, leading it towards perfection.

If you’re an MLFinLab subscriber, seize this moment. Dive into our beta testing phase and be an influential part of MLFinLab’s evolution. Your feedback is not just welcomed—it’s essential.

For our subscribers ready to embark on this journey, installation instructions are available via the official MLFinlab documentation, which is accessible via the Portal. Here’s to innovation, collaboration, and the next chapter in the MLFinLab saga.

We are excited to announce the release of MLFinlab v2.2.0!

Coinciding with our recent closed beta announcement of integrating MLFinlab with Docker (please go sign up if you’re interested!), we’re excited to announce MLFinlab v2.2.0 that adds support for Python 3.10 and 3.11. This now brings support to every major currently-supported version of Python.

We hope this will make using MLFinlab in your various production environments easier in the future.

As always, for installation instructions, please see the official documentation (which is available from the Hudson & Thames portal if you have an active subscription).

We are excited to announce the release of PortfolioLab v0.6.0! PortfolioLab is our landmark collection of portfolio optimization algorithms and tools.

This release is mainly a maintenance release, and brings long-awaited support for Python 3.9, 3.10 and 3.11. This means that you can now use PortfolioLab with Python 3.8+, up to and including the latest stable version of Python.

This has been a long-requested feature from our users, and as a result we’re particularly excited with this release.

As always, for installation instructions, please see the official documentation (which is available from the Hudson & Thames portal if you have an active subscription).

We’re excited to announce the latest release of MLFinlab, our suite of composable components and production-ready algorithms for developing trading strategies that leverage machine learning.

Highlights of this release includes Python 3.9 support, usability improvements to our volatility estimators, productivity improvements when generating bars from tick data, as well as a brand new API reference page. Some smaller changes include updates to more examples, and converting additional examples to doctest for increased reliability and testability.

We’ll break down some of the major changes below, and how they will impact users who are upgrading.

Python 3.9 support

This release officially marks the inclusion of Python 3.9 support to MLFinlab. This has been a sought-after improvement for some time, and we are happy to finally announce its general availability. This also lays the foundation for future Python 3.10 support, which is currently on the roadmap.

DatetimeIndex for creating bars

We’ve updated the behaviour of the data_structures module to now set the date_time column as a DatetimeIndex, instead of a separate column:

>>> from mlfinlab.data_structures import time_data_structures
>>> # Get processed tick data csv from url
>>> tick_data_url = "https://raw.githubusercontent.com/hudson-and-thames/example-data/main/processed_tick_data.csv"
>>> time_bars = time_data_structures.get_time_bars(
...     tick_data_url, resolution="D", verbose=False
... )
>>> time_bars  
            tick_num    open   high    low   close  volume  cum_buy_volume  cum_ticks  cum_dollar_value
date_time
2023-03-02     13642  804.25  808.0  803.0  807.00   49208           25816      13641      3.963169e+07
2023-03-03     66322  807.00  812.5  806.0  810.75  171378           94591      52680      1.388561e+08

Why have we made this change? Most of the downstream functions expect to receive input as a DataFrame, where the index is the date_time. Users would have to manually set the date_time column as the index each and every time after creating their bars. This is tedious, is easily forgotten, and can lead to cryptic downstream errors. As a result, we’ve updated the default behaviour to do this automatically.

We’ve also updated all of our examples to reflect this new behaviour.

If your current code does manually set the date_time as the index, you’ll need to remove these parts from your code to prevent an error from being raised. Fortunately removing the code shouldn’t be a difficult process.

Improvements to volatility estimators

Previously, volatility estimators in our relied on the implicit column order when performing calculations. This is error-prone, and wasn’t documented clearly. Unfortunately this made it possible to get erroneous results without warning. As a result, we’ve updated the volatility estimators to instead use column names directly, thus ensuring correct calculations. Depending on the estimator in question, we now check for the following lowercase column names in order to perform the estimation: 'open', 'high', 'low', 'close'. This may require you to update your code, depending on how you’ve named your columns.

We’ve also updated all of our examples to reflect this new approach, so you can refer to them for additional context:

>>> import pandas as pd
>>> import yfinance as yf
>>> from mlfinlab.features.volatility_estimators import parkinson
>>> # Retrieve the DataFrame with time series of returns
>>> ohlc = pd.read_csv(
...     "https://raw.githubusercontent.com/hudson-and-thames/example-data/main/yahoo_finance_SPY_2012-03-26_to_2023-12-06.csv",
...     parse_dates=[0],
...     index_col=0,
... )
>>> ohlc.columns = [
...     col.lower() for col in ohlc.columns
... ]  # volatility estimators expect lower-case column names
>>> list(ohlc.columns)
['open', 'high', 'low', 'close', 'adj close', 'volume']
>>> # Calculate volatility with Parkinson estimator (Sinclair formula)
>>> parkinson_sinclair = parkinson(ohlc, 22, False)
>>> # Calculate volatility with Parkinson estimator (De Prado formula)
>>> parkinson_deprado = parkinson(ohlc, 22, True)

API Reference Docs

We’ve added an API reference to our documentation, which serves as a useful reference for every single module, class and function in MLFinlab. If you’re already familiar with a component, and just need to reference the API, this is a quick way of doing so without having to scroll through the entire user-guide. It’s also a new way to explore what’s on offer in MLFinlab. A demo of the API reference can be seen below:

We believe this is a very useful addition to the documentation.

Changes to ml_cross_val_score

We’ve slightly tweaked the ml_cross_val_score function to now require the require_proba argument as input. Previously, require_proba had a default value of False, which led to accidental errors and user confusion when passing in a scoring function that required probabilities as input rather than labels. Since the argument was optional, users were unaware that they had to do a explicitly specify require_proba=True. This has now been rectified, and require_proba is no longer an optional argument.

Other improvements

We’ve updated a number of examples, and updated links to our notebooks, which are now available on a public repository. Not everything has been migrated across yet, given the immense size of our documentation, but we will continue to steadily do so as we continue to improve and update the various modules in MLFinlab.

Upgrading

As always, you can follow the installation instructions in the documentation for installing the latest version of MLFinlab.

We are excited to announce the release of PortfolioLab v0.5.0!

This is primarily a maintenance release, where we have updated the majority of our dependencies to their latest stable version. This ensures we maintain the maximum reliability and security possible, while also enabling users to remain compatible with up-to-date packages in their own development environment. This is designed to lay the foundation for future developments on PortfolioLab, which we’ll be announcing in the future with future releases.

This release also contains a minor workaround that allows users to specify which network interface to use when fetching a MAC address during license key verification. The interface can be specified using the PORTLAB_MAC_INTERFACE environment variable.

We recommended creating a new virtual environment when upgrading, given the large upgrade in dependencies.

For instructions on installing PortfolioLab, you can find the link to the documentation via the Portal.

Hudson & Thames has consistently been at the forefront of delivering innovation in the quantitative finance landscape. Our flagship offering, MLFinLab, is a testament to our commitment, presenting a robust Python library teeming with production-ready algorithms derived from top-tier academic journals and advanced textbooks. It’s an essential tool, uniquely designed to empower portfolio managers and traders by providing reproducible, interpretable, and easy-to-use tools.

Today, we’re attempting to make your MLFinLab experience even more seamless. We’re thrilled to announce the upcoming closed beta launch for the Dockerized version of MLFinLab.

Tackling Python’s Challenges with Docker

Python, as powerful and flexible as it is, does present some unique challenges, one of which is the infamous “Python dependency hell”. This phrase refers to the complications encountered when managing the different versions and dependencies that Python applications require. Navigating these issues can be a time-consuming and complex task, especially when dealing with large-scale, intricate projects like MLFinLab.

Moreover, in managed environments, you may find pre-installed packages that can potentially conflict with other dependencies, causing incompatibility issues that can impact the stability of your application. Even though cross-platform compatibility can be achieved, it often requires considerable manual effort and introduces more variables that could affect overall reliability.

This is why we’d like to introduce Docker.

Reimagining MLFinLab with Docker

Docker is designed to package and isolate applications with their dependencies into a standardized unit for software development. By distributing MLFinlab in a Docker container, we can effectively overcome the complexities of Python dependency management. Docker containers bundle the MLFinLab application and all its dependencies into one easily distributable and quick-to-set-up package. For our users, this means you’ll spend less time wrestling with system-specific issues and fighting dependencies and more time leveraging MLFinLab’s robust features.

The Dockerized version of MLFinLab brings the promise of cross-platform compatibility and reliability. You can run MLFinLab on any system that supports Docker, be it Linux, Windows, or macOS. No more cross-platform inconsistencies or version conflicts, just a smooth, reliable application experience. The incorporation of Docker also paves the way for exciting new deployment options in the future, offering an unparalleled level of flexibility (particularly if you’re an institutional quant, where your development environment is managed by an IT team — but we’ll have more to say about this soon).

What will this practically look like?

Forget about the cumbersome process of creating a new Python environment and painstakingly installing MLFinLab with all of its dependencies using pip. Instead, imagine an effortless system that does all the work for you. That’s precisely what we’re bringing to you with our Dockerized MLFinLab.

You’ll simply pull a Docker image from the cloud, already fully loaded with all the necessary dependencies. As you initiate the container, we’ll verify your API key and seamlessly pull and install MLFinLab inside the container. Following this, a Jupyter Lab or Notebook instance will be launched, all ready and set for you to use.

What’s truly remarkable about this process is its isolation from your actual system. Everything takes place within the Docker container, leaving your system pristine and untouched. This means no more concerns about managing dependencies or ensuring a locally working version of Python.

In essence, the Dockerized MLFinLab delivers a radically simplified installation experience, one that we believe holds significant advantages over the traditional installation process of MLFinLab. It’s a game-changer, designed with user convenience at its core.

Join the Closed Beta Testing Phase

We’re now inviting all our users to participate in this exciting development by joining our closed beta testing phase. While the opportunity to sign up is open to everyone, our existing customers will be given priority access as a token of our appreciation for their ongoing support. Feedback is a vital part of this process—your insights will be instrumental in helping us enhance and perfect this Dockerized version of MLFinLab.

We’re eager to hear your insights, feedback, and suggestions. The timeline for the beta testing phase extends over the next few months, followed by the official release if we reach the level of reliability and performance , which will be guided and informed by your invaluable feedback.

An Exciting Leap Forward

The Dockerized version of MLFinLab represents a significant leap forward in quantitative finance software. With the promise of simplified deployment, enhanced cross-platform compatibility, and faster setup, it’s set to become an invaluable tool for portfolio managers, traders, and quantitative analysts alike.

Sign up for our closed beta test today and play an integral part in shaping the future of MLFinLab. We can’t wait to hear your feedback.

To those who are interested, you can sign up to the beta using the button below, and we’ll be in touch when we’re ready to launch.

Recently, we released an updated v0.8 version of ArbitrageLab, our innovative platform that opens up a world of pairs-trading opportunities. Today, we’re excited to offer you a discount to celebrate this release and empower you to take your trading strategies to new heights.

For the entire month of July, we invite you to join us on our journey with an incredible 85% discount on ArbitrageLab subscriptions by using ARBLAB08RELEASE as the discount code at checkout. This discount will be applied for the lifetime of your subscription, allowing you access to ArbitrageLab’s cutting-edge features and capabilities at the discount price for as long as you maintain your subscription.

ArbitrageLab is not just another trading tool; it’s a comprehensive collection of algorithms derived from the best academic journals and graduate-level textbooks. Our focus is on the branch of statistical arbitrage known as pairs trading, and we have expanded our implementations to include the latest methods that trade a portfolio of n-assets (mean-reverting portfolios).

By leveraging the power of ArbitrageLab, you gain access to a range of advanced algorithms that have been rigorously tested and refined. These algorithms are designed to identify trading opportunities and exploit market inefficiencies, giving you a competitive edge in the financial markets. With our latest release, v0.8, we have further refined and enhanced our algorithms, ensuring that you have the most powerful tools at your disposal.

Again, to take advantage of the discount, simply use the code ARBLAB08RELEASE during the checkout process. This limited-time offer is our way of expressing gratitude for your support and providing you with an affordable opportunity to harness the true potential of ArbitrageLab.

Should you have any questions or require assistance, our team is ready to assist you. Feel free to reach out to us.

Thank you for being an integral part of our community. We’re excited to witness your trading endeavors flourish with ArbitrageLab v0.8.

To your success,
Hudson & Thames Team

We are excited to announce the release of ArbitrageLab v0.8!

This is primarily a maintenance release, where we have updated the majority of our dependencies to their latest stable version. This ensures we maintain the maximum reliability and security possibly, while also enabling users to remain compatible with up-to-date packages in their development environment. This release also lays the foundation for future developments on ArbitrageLab, which we’ll be announcing in the future.

We recommended creating a new virtual environment when upgrading, given the large upgrade in dependencies.

For instructions on installing ArbitrageLab, you can find the link to the documentation via the Portal.

We are delighted to announce the launch of the long-anticipated MLFinlab v2.0.0! This new release brings a host of enhancements and fixes, all of which significantly improve the package’s functionality and usability.

A key feature of this release is that all examples have been thoroughly updated and modified across-the-board. This ensures that users can now run them “as-is”, providing an improved learning and on-boarding experience. We’ve spent a significant amount of time debugging and testing to make this possible. Additionally, we have started migrating our example code to doctest, which helps ensure that all of our examples execute correctly with every release.

Important note: With the release of MLFinlab 2.0.0, we have implemented a more streamlined import system. Now, instead of importing the complete top-level package, you can import only the modules and functions you need. This change significantly enhances import efficiency, reduces confusion, and lets you treat MLFinlab as a collection of composable components. All of our examples reflect the new import pattern. If you are updating existing scripts in-place to work with MLFInlab 2.0.0, you may need to update your imports.

In addition to this, we’ve incorporated a large list of bugfixes and some performance improvements. Note that we have updated some of our function names in the `util/generate_dataset` module to improve clarity.

This version of MLFinlab also comes with a large bump in dependencies across-the-board, which is a welcome addition to everyone working in more up-to-date Python environments.

In conclusion, MLFinlab v2.0.0 represents a significant step forward in our commitment to advancing machine learning in finance. We’re thrilled to offer you this new version, packed with updates and improvements, and we can’t wait to see what amazing things you’ll do with it.

How to upgrade

To upgrade to v2.0.0 of MLFinlab, please read the official documentation and follow our new installation instructions.

Coming soon: Dockerized MLFinlab

In the coming weeks, we’re aiming to bring MLFinlab to you in a dockerized form. This will allow you to perform strategy development, research, analysis, and more within an isolated environment across any platform without any of the struggle. To stay tuned for this announcement and release, please subscribe to our newsletter so that you can keep in touch.