Does anyone have any recommendations on how I would go about forecasting Microsoft revenue using python + time series or ML (recommended techniques e.g Random-forest)? (I have past revenue and share price data).

  • $\begingroup$ You will need way more data than that. $\endgroup$
    – JahKnows
    Commented Sep 6, 2018 at 1:06
  • $\begingroup$ care to elaborate ? $\endgroup$
    – Moses S
    Commented Sep 6, 2018 at 1:07
  • 2
    $\begingroup$ If it were that easy we would all be multi-millionaires. I'll elaborate why this is in an answer. $\endgroup$
    – JahKnows
    Commented Sep 6, 2018 at 1:13
  • $\begingroup$ it's a forecast so it would come with some margin of error :) $\endgroup$
    – Moses S
    Commented Sep 6, 2018 at 1:23

2 Answers 2


Machine learning is a powerful tool however it is not a silver bullet which can predict anything from nothing. For example, I cannot predict your dinner tomorrow night based on data of what you are wearing (unless you are a very particular individual). This is an exaggeration however you can see that in order to make some prediction it is vital that your data correlates with your desired targets.

Predictive models have always existed. What differentiates machine learning from analytical predictive models is that it introduces algorithms which tune model parameters efficiently. As a consequence we can now train models using much more features than was previously possible.

In order to be able to predict some value reliably, your data needs to have embedded information which correlates with that value. For example, if all your features contain no information which correlates with the predicted targets then no matter how powerful your model is, it will never be able to predict the target reliably. Furthermore, a target value which is very noisy will require you to have substantially more data.

This is exactly the case for stocks, a stock price is not dependent on only the revenue. In fact the revenue has very little impact on the stock price. Thus, you cannot expect the target predicted value to be reliably determined using this low information feature.

In order to predict stock prices you will need much more data, here are some good starting features:

  • revenue
  • market index
  • stock prices of similar companies
  • stock trade volumes
  • stock total volumes
  • etc...

You can get really creative with features. For example, it's common for stock prediction models to use sentiment analysis from daily news articles.

  • $\begingroup$ Thanks but you're answering a share price prediction question which is rather different to a revenue forecast which is a lot less noisy . $\endgroup$
    – Moses S
    Commented Sep 6, 2018 at 1:34
  • $\begingroup$ Regardless there will always be noise in the data and I doubt you can predict something so complex with a single feature. $\endgroup$
    – JahKnows
    Commented Sep 6, 2018 at 1:51

@JahKnows' answer which has nicely explained the importance of correlated features. I would like to elaborate on the techniques that can be explored for the problem.

There are powerful time series and machine learning techniques that can be used for the problem at hand. The problem has a time component to it. And the data that you would be having would be auto correlated. Ex- The revenue for present year will be correlated with the revenue for past year.

Does anyone have any recommendations on how I would go about forecasting Microsofts revenue using python + time series or ML (recommended techniques e.g Random-forest).

As far as recommendations are concerned, they will purely depend on the kind of data you have. But as you have described the problem I would like to recommend from the two different schools of techniques: Time-series and Machine Learning


Assuming you have some features in your data set. You can go with developing a multivariate time series model. Vector Autoregression (VAR) models have been successfully applied in the domain econometrics. That can be surely borrowed.

Machine learning:

Recurrent neural networks have been widely used for problems of predicting time series variables, in recent times. A variant of RNN, Long short term memory (LSTM) have been proven to be more successful than simple RNNs for the same.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.