NORMA eResearch @NCI Library

Investigating the Application of Tree-Based Machine Learning Techniques to Predict the Margin of Safety in Potential Stock Investments

Scully, Keith (2024) Investigating the Application of Tree-Based Machine Learning Techniques to Predict the Margin of Safety in Potential Stock Investments. Masters thesis, Dublin, National College of Ireland.

[thumbnail of Master of Science]
Preview
PDF (Master of Science)
Download (1MB) | Preview
[thumbnail of Configuration Manual]
Preview
PDF (Configuration Manual)
Download (649kB) | Preview

Abstract

The stock market provides generous conditions for increasing and preserving wealth over the long term. Value investing is a strategy focused on using fundamental analysis to estimate the intrinsic value of a company, then seeking to take advantage of divergences between market price and intrinsic value to minimise downside risk and maximise upside potential. This mispricing delta is regularly referred to in the investing world as the “margin of safety”. Valuing a business is a complex task requiring specialised knowledge and consequently is routinely neglected by many investors. This leads to buying decisions that are based more on intuition and market momentum rather than by informed decision-making, which is often at an increased risk of financial loss. This research proposes a novel approach to directly estimate the “margin of safety” available on US company stocks by leveraging machine learning techniques to predict the degree of mispricing based on current market prices and publicly available financial accounting data. A number of tree-based learning algorithms were selected and appropriate predictive models were developed. The final XGBoost model was found to be most performant with an RMSE of 8.7%. Using SHAP explainable AI techniques it was also determined that elevated levels of Free Cash Flow were strongly associated with enhanced margin of safety values. Further experimentation with the final model using unseen historical data revealed that a portfolio of stocks selected based on model outputs had significantly outperformed the broader stock market over a recent 10-year period. This study demonstrates that machine learning can be applied successfully to value investing approaches, through the selection of investments that are grounded on current price alongside fundamental business performance. The results are encouraging for retail investors who can benefit from this research by being more informed on the risk of investing given current market pricing, while simultaneously increasing the potential of positive investment returns into the future.

Item Type: Thesis (Masters)
Supervisors:
Name
Email
Hasanuzzaman, Mohammed
UNSPECIFIED
Uncontrolled Keywords: Value Investing; Fundamental Analysis; Margin of Safety; Machine Learning; Tree-Based Algorithms; Explainable AI
Subjects: Q Science > QA Mathematics > Electronic computers. Computer science
T Technology > T Technology (General) > Information Technology > Electronic computers. Computer science
Q Science > QH Natural history > QH301 Biology > Methods of research. Technique. Experimental biology > Data processing. Bioinformatics > Artificial intelligence
Q Science > Q Science (General) > Self-organizing systems. Conscious automata > Artificial intelligence
H Social Sciences > HG Finance > Investment
Q Science > Q Science (General) > Self-organizing systems. Conscious automata > Machine learning
Divisions: School of Computing > Master of Science in Data Analytics
Depositing User: Ciara O'Brien
Date Deposited: 04 Sep 2025 14:11
Last Modified: 04 Sep 2025 14:11
URI: https://norma.ncirl.ie/id/eprint/8796

Actions (login required)

View Item View Item