Augmenting Investment Analysts with Data Science

How fundamental investing can benefit from Machine Learning

Charles Brecque
Towards Data Science

--

Fundamental investing consists in building a thesis of how the world spins and where it is heading, and then identifying relevant investments that are aligned with the strategic vision. The second part can be quite tedious as it implies combing through the financial metrics of hundreds to thousands of corporations that fit within the strategy to identify investments that are under or over priced to then buy or sell respectively. This article will show how it is possible to fit a Machine Learning model to a fundamental investment strategy in order to allow analysts do scale their investment thesis in a transparent and interpretable way. The modelling will be done with AuDaS, an accessible and easy to use Data Science journey enabler.

Disclaimer: This communication is for informational purposes only. It does not and is not intended to constitute investment advice or an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice.

Downloading the Data

The financial ratio data was retrieved from Morningstar using this simple script:

datadict={}
for name in tickers:
for attempt in range(10):
try:
datadict[name] = (pd.read_csv('http://financials.morningstar.com/ajax/exportKR2CSV.html?t='+name, skiprows=2))

except:
print('error with '+name+' - retrying')
time.sleep(0.3*attempt+0.5)

else:
break
else:
print('unable to import '+name)

For the purpose of simplicity, I then sampled 22 features from the original 100.

The Investment Thesis

For each company we award a score of 1 if is a good investment, 0 if not. The score was awarded on a very simplified thesis that a stock is good if its earnings per share increased the following year. As we are considering yearly financials, we are also going to take annual snapshots of companies over several years to build a sensibly balanced data set. This also plays to the fact that an investment doesn’t always remain good over the years!

We would now like to build a classifier with AuDaS that has learnt the relationship between the inputs and the score to predict which investments are worth holidng.

Pre-processing the Data

Here is a snapshot of the data uploaded to AuDaS.

After initially analysing the data set, AuDaS was able to identify some missing values in the Payout Ratio % column which triggered some advice on how to correct it. When the Payout Ratio is missing, it simply means that no dividends were returned to the investors so we can fill the missing values with 0. AuDaS makes it very easy to act on the advice.

Applying the advice then adds a step to the data workflow for auditing purposes which can also be reversed if necessary.

We can then check out the histogram view to visually see how our “good” and “bad” companies distribute across the financial ratios.

There doesn’t seem to be a clear pattern but hopefully AuDaS will be able to find us a Machine Learning model accurately maps the dynamics between the variables!

Building the model

In AuDaS, we only need to specify that we wish to predict the score column as it has automatically excluded the ticker column (as it has the level identity). Moreover, AuDaS provides a robust framework for training models that are not over-fitted and that work in production.

The modelling in AuDaS is powered by Mind Foundry’s proprietary optimiser OPTaaS. It uses a Bayesian approach which learns from each iteration what works and doesn’t to converge towards the best solution more efficiently! OPTaaS is available as a separate offering (trial link available from my profile) and is currently used by Quantitative Hedge funds globally and Quantum Computers!

After a couple of iterations, AuDaS has already found a model with a 67% classification accuracy with a simple Random Forest classifier.

AuDaS also provides the Relative Feature and various performance statistics. In our case, it seems like the Book Value Per Share has the strongest impact on the Score, followed by the Payout Ratio % and Earnings per share.

Making Predictions

The models built by AuDaS can either be used within the platform or can be deployed through an application or an excel spreadsheet. I then took the 2018 Financial data for Microsoft from Morningstar and asked AuDaS to predict its score.

AuDaS uses LIME to explain the impact of each feature on the prediction. As you can see, the intricacies between the features are more complex than expected which shows had hard it is for analyst to make conclusions without Machine Learning!

Clustering the stocks

We can then extend the analysis by asking AuDaS to cluster the companies. AuDaS identified 8 clusters using K-means clustering:

This analysis can be used for final risk-analysis when constructing the portfolio.

Other tangent use cases which haven’t been presented here could be:

  • Forecasting company revenues to derive valuations
  • Predicting the failure of trades for trade settlement
  • Marketing/Sales optimisation for funds that rely on distribution strategies

You can watch the end-to-end walkthrough bellow:

Please don’t hesitate to reach out if you have any questions or wish to see a live demo of AuDaS!

[UPDATE: I have started a tech company. You can find out more here]

Team and Resources

Mind Foundry is an Oxford University spin-out founded by Professors Stephen Roberts and Michael Osborne who have 35 person years in data analytics. The Mind Foundry team is composed of over 30 world class Machine Learning researchers and elite software engineers, many former post-docs from the University of Oxford. Moreover, Mind Foundry has a privileged access to over 30 Oxford University Machine Learning PhDs through its spin-out status. Mind Foundry is a portfolio company of the University of Oxford and its investors include Oxford Sciences Innovation, the Oxford Technology and Innovations Fund, the University of Oxford Innovation Fund and Parkwalk Advisors.

--

--