CNN for Short-Term Stocks Prediction using Tensorflow
In machine learning, a convolutional neural network (CNN, or ConvNet) is a class of neural networks that has successfully been applied to image recognition and analysis. In this project I’ve approached this class of models trying to apply it to stock market prediction, combining stock prices with sentiment analysis. The implementation of the network has been made using TensorFlow, starting from the online tutorial. In this article, I will describe the following steps: dataset creation, CNN training and evaluation of the model.
In this section, it’s briefly described the procedure used to build the dataset, the data sources and the sentiment analysis performed.
Ticks
In order to build a dataset, I first chose a sector and I time period to focus on. I decided to pick up the Healthcare sector and the time range between 4th January 2016 and 30th September 2017, to be further splitted in training set and evaluation set. In particular, the list of ticks was downloaded from nasdaq.com, keeping only companies with Mega, Large or Mid capitalization. Starting from this list of ticks, stocks and news data were retrieved using Google