Inspiration

There are many applications that detect stock prices, but very few visualize how the app came to a particular conclusion for predicting a particular stock by visualizing the data output. I wanted to create a web application that uses PyTorch in the backend and a Flask frontend to create and train a model then display graphs that explain the stock prediction's reasoning.

What it does

The website lets a user enter a stock symbol and the number of epochs that they want to train a model for, then the website trains the model, then displays the graph of stock prices, the mean squared error every 5 epochs, a graph of the training data vs actual data and a graph of the testing data vs actual data.

How we built it

I built the backend model using an LSTM in PyTorch and built the frontend using Flask and HTML. In order to create and visualize graphs, I used other Python libraries to create graphs.

Challenges we ran into

I had some challenges with creating plots and displaying them using Flask, but I was able to address them by saving the images as a file then displaying the file in a separate page.

Accomplishments that we're proud of

I'm proud of the fact that I was able to get a working application that uses machine learning insights in real time and makes it easy to visually see the outputs of training the machine learning model.

What we learned

I learned about creating an LSTM in PyTorch using Python and how to combine a Flask application's frontend with machine learning insights from the backend.

What's next for PyTorch Stock Predictor

Right now, the application supports five major stocks, but in the future I could expand the number of stocks so that users gain more insights.

Share this project:

Updates