Stock Portfolio

Machine Learning | Neural Network Architecture

Project Goals

There were three main goals in this project:
First, to use state-of-the-art machine learning (deep learning) techniques that would predict the behavior of stock return.

Secondly, to determine what stocks to buy, hold and sell based on the stock predictions.

Finally, to construct a portfolio that would outperform the S&P 500 buy-and-hold benchmark without incurring any additional risk.

Solution Design

For the analysis and development of our Machine learning model, we selected the top 50 Stocks from the S&P 500 stock list. Yahoo Finance was tapped for historical data.  

After pre-processing, we used a deep learning neural network called Bi-LSTM.

Some of the hyper-parameters used were: 

  • Number of units

  • Dropout rate

  • Type of optimizer, etc.


A set of back-tests based on prediction results were conducted for the bull as well as bear market conditions.

For bull market, a long-short strategy based on equal-weighted portfolios outperformed the benchmark return with similar systematic risk as the market.

For the bear market scenario, the equal-weighted portfolio achieved over 15% excess return with marginally higher systematic risk than the market.

Next Steps

To speed up model training without sacrificing performance, GRU (a variation of LSTM and RNN) could be considered.

There are opportunities to explore alternatives for portfolio construction. One method is the Candlestick analysis using GANs (Generative Adversarial Networks). 

Finally, considerations for the long-run include exploring other market indexes with small-cap stocks and assets of diverse industries.

We deliver actionable insights by empowering your organization with AI so you can focus on business growth.

We offer the leading edge end-to-end AI solutions, enabling every employee, customer, and citizen with sophisticated AI technology and easy-to-use AI applications. With our solutions, our partners can become leaders in their respective domains by becoming more innovative in serving their customers, collaborating among all key stakeholders in extracting business value and reducing costs.