AI News, Machine Learning & Artificial Intelligence Archives artificial intelligence

Financial Machine Learning Part 1: Labels

In the previous post, we’ve explored several approaches for aggregating raw data for a financial instrument to create observations called bars.

Below you’ll find a slightly modified function directly from Lopez De Prado, with comments added for clarity: Adding Path Dependency: Triple-Barrier Method To better incorporate the stop-loss and take-profit scenarios of a hypothetical trading strategy, we will modify the fixed-horizon labeling method so that it reflects which barrier has been touched first — upper, lower, or horizon.

The labeling schema is defined as follows: y=1 : top barrier is hit first y=0 : right barrier is hit first y=-1 : bottom barrier is hit first What about the side of the bet?

First, we define the procedure for getting the timestamps of the horizon barriers: Now that we have our horizon barriers, we define a function to set upper and lower barriers based on the volatility estimates computed earlier: Finally, we define a function to compute the labels: Putting it all together: On a conceptual level, our goal is to place bets where we expect to win and not to place bets where we don’t expect to win, which reduces to a binary classification problem (where the losing case includes both betting on the wrong direction and not betting at all when we should have).

To characterize this more formally, let us first define: ŷ ∈ {0, 1, -1} : prediction of the primary model for the observation r : price return for the observation Then at prediction time the confusion matrix of the primary model looks like the one below.

To reflect this, our meta-labels y* can be defined according to the diagram: y*=1:true positive y*=0:everything but true positive In effect, the primary model should have high recall — it should identify more of the true positives correctly at the expense of many false positives.

While it isn’t always a worthy trade-off, remember the context of trading — we miss out on some trading opportunities (false negatives), but that is a cheap price to pay for cutting down many trades that blow up in our faces (false positives).

While neither model is great, remember that we are merely demonstrating a technique for improving classifier efficiency, which can conceivably work well on a larger dataset, better model, and more powerful features.

In addition to improving F1 scores, meta-labeling has another extremely powerful application — it can add a machine learning layer on top of non-ML models, including econometric forecasts, fundamental analysis, technical signals, and even discretionary strategies.

Artificial Intelligence and Machine Learning Solution

Learn how AI/ML can help you make better decisions. For more information about Cisco AI/ML computing solutions, please visit

Big Data, Machine Learning, and AI in Portfolio Management

BlackRock's Kevin Franklin explains how investors get comfortable with applying these tools to money management. For all Morningstar videos: ...

Great Debate - Artificial Intelligence: Who is in control? (OFFICIAL) (Part 01)

Part 02 - Will progress in Artificial Intelligence provide humanity with a boost of unprecedented strength to realize a better future, ..

The truth about Artificial Intelligence in HR

In this video I share some relevant research on AI, and the more interesting business scenario with regards to HR - automation in a cost reduction context.

Billionaire Kenneth Griffin: Investing, A.I and Career Advice (2017)

An interview and Q&A with billionaire CEO of Citadel, Kenneth Griffin. In this interview, Kenneth discusses how Citadel invest and its use of humans compared to ...

What is AI? - Artificial Intelligence current state

What is AI (Artificial Intelligence): This video is an explanation of the definition of AI (Artificial Intelligence), the 3 main categories: ASI (Artificial Superintelligence) ...

The AI Poker Champions

Artificial intelligence takes on Texas Hold 'Em. Learn more about Artificial Intelligence: Learn more about ..

Machine learning meets NASA archives

To celebrate 60 years of NASA, the Google Arts & Culture Lab explored NASA's archive of 127000 historic images stretching back to 1915, and analyzed them ...

Great Debate - Artificial Intelligence: Who is in control? (OFFICIAL) (Part 02)

Part 01 - Will progress in Artificial Intelligence provide humanity with a boost of unprecedented strength to realize a better future, ..