Search code examples
pythontensorflowlinear-regressiontensorflow2.0prediction

Example for Tensorflow prediction with more than one independent variable


I am searching for an example to predict data with Tensorflow. I already tried some codes but I am a beginner in Tensorflow and Python. For example I predict a stock price by training and testing with old stock prices. Now I would like to integrate more than only the old stock prices, like trade volume, to predict future stock prices. How can I implement this?


Solution

  • Your question is very broad, so it's hard to give specific advice. If you're a beginner in python, I would not recommend Tensorflow as the place to start. I would assume that if you're using historical prices to predict future prices, then you're trying to make predictions as a time series? I'd recommend you check out the machinelearningmastery series on time series prediction.

    https://machinelearningmastery.com/findings-comparing-classical-and-machine-learning-methods-for-time-series-forecasting/

    Specifically to your question, here is a tutorial for many different models using multivariate inputs.

    https://machinelearningmastery.com/how-to-develop-machine-learning-models-for-multivariate-multi-step-air-pollution-time-series-forecasting/

    Once you get more comfortable with modeling, then I'd recommend you check out the notebooks from the machine learning competition site kaggle.com. They did a stock market prediction competition, and there are a lot of examples of different models people built to predict stock market returns within the parameters of the competition.

    https://www.kaggle.com/c/two-sigma-financial-news/notebooks