0
$\begingroup$

For time related problems like, for example, stock prediction:

Let's say we have 300 days of data, 10 features, and one target: the price.

Why, for the training, we only need the price of the 300th day? I know this is the way LSTM models work, but wouldn't it be useful to take into account the price of the 299 other days for the model?

$\endgroup$

2 Answers 2

0
$\begingroup$

Time-series analysis has two main goals:

  • To identifying the nature of the phenomenon represented by the sequence of observations, and
  • To forecast (predicting future values in time for a variable).

NOTE: In this respect, models try to get pattern using historical values. Do not confuse here between forecasting (predicting future values) and prediction.

For time-series prediction(forecasting) problems, the models ( ARIMA, LSTM) try to extract trend, seasonality, and residual from the list of historical values e.g. price from 300 historical dates or time. Therefore, there is no need to look for dependent variables here. We must be clear, the time series forecasting algorithm extrapolate historical trend to near and far future. They do not predict target variable based on dependent variables. This is the main reason you will see time-series models only work with single variable who's historical data-points become input and future data points become target.

Reference:

  1. http://www.statsoft.com/Textbook/Time-Series-Analysis
$\endgroup$
3
  • $\begingroup$ Thanks for your answer. The difference is that, most of the time, in time series, we only use the price and the date as variables. Here, there are a lot of features. So, I was wondering if I should incorporate the labels of the past days, or only the labels of the last day? For example, if I want to predict a temperature, and I have 10 features, and seven days. Should I use the temperature of the six first days in my LSTM model, or only the seventh day temperature as label?? $\endgroup$
    – nolwww
    Commented May 23, 2019 at 1:54
  • $\begingroup$ And then, we can say that here, it’s not a time series problem, but just a prediction based on several days of data for each point. $\endgroup$
    – nolwww
    Commented May 23, 2019 at 2:11
  • $\begingroup$ No, this is a wrong conclusion. Time-series models use historical data points as dependent to predict future points ( forecast). $\endgroup$
    – DataFramed
    Commented May 23, 2019 at 9:25
0
$\begingroup$

It seems that you are confused about what the difference between a feature and a label is.

Your label is the 'gold' outcome that you are trying to predict. In stock prediction, this is often a single number, i.e. some form of regression. For a given time series you are trying to predict the price at a future point in time.

What you are suggesting is very well possible, and basically how (linear) regression works: given 300 data points, make a function that fits the data. Then get the value from the function from a given x. LSTMs and other architectures are of course more complex, but the idea is similar.

You could, for instance, feed the prices of each time stamp as a feature to the LSTM. It should be a powerful predictor. The neural network will try to figure out which features are important at what stage in time.

$\endgroup$
4
  • $\begingroup$ Hello, I'm totally aware of the difference between feature and label. What I'm saying is that, in a classic model, you have, say, 10 features, and one label. Here, I have these 10 features for 7 successive days. Thus, I use a LSTM to use this additional strength. However, I also have the labels for everyday, but, with a classic LSTM, Y is only the last day labels. So, my question was: If I want to use Y of the other 6 days, may I: 1) Do as you suggest and include these 6 days labels in my features 2) Or, there is a model that can take it differently. $\endgroup$
    – nolwww
    Commented May 23, 2019 at 1:51
  • $\begingroup$ Yes, you can add it as a feature for the previous days. $\endgroup$ Commented May 23, 2019 at 7:18
  • $\begingroup$ Thanks a lot. So, that's the only way to use it? $\endgroup$
    – nolwww
    Commented May 23, 2019 at 8:11
  • $\begingroup$ You can also build a simple regression model next to the RNN, and in some way concatenate its output (average, max pool, ...) $\endgroup$ Commented May 23, 2019 at 11:28

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.