1
$\begingroup$

Context

I'd like to build a regression model for this data to predict a user's test scores given their study habits.

Basically, the variables are in two separate csv tables similar to the ones below. Eventually, I'd like to create a forecasting model.

Training variables:

  • Time series data of study habits (multidimensional: location, duration, date, user_id)

Target variables:

  • Test scores (scores, date, user_id)

Problem

  1. I'm not sure how to actually put together instances regarding time. Do I just say that every training instance before the next test date gets that test result as the target variable?
  2. Is there a term for temporally aligning data in a time series or techniques?
$\endgroup$

1 Answer 1

1
$\begingroup$

What you are trying to accomplish is called sequence prediction. It takes in a sequence of data, and spits out a score (target variable).

Time-series data is usually formatted as 3D arrays with shape (batch size, sample length, data). So in your case, the data would be (location, duration, date, user_id). It's preferable to have all sequences be of the same length by adding padding at the end of sequences that are too short. The padding can be dealt with in the model training itself later on.

I'd keep the date variable in the data itself, but maybe format it as an offset, so make the first time studying equal to 0, the second instance equal to the number of hours later (like 24 for the next day) and have the prediction variable as the last offset.

$\endgroup$
5
  • $\begingroup$ If the answer has sufficiently answered your question, make sure to select it as the correct answer such that future visitors can better find what they are looking for. $\endgroup$ Commented Apr 14, 2023 at 10:52
  • $\begingroup$ It does, but I'm not sure about data leakage with sequence prediction. I have a large gap between sampling and tests, like samples are daily, whereas, tests roughly every 90 days, does this matter? $\endgroup$ Commented Apr 14, 2023 at 11:18
  • 1
    $\begingroup$ Data leakage is, to my knowledge, an unrelated topic. However, whether the gap is too large or too varied to predict is heavily dependent on the data. If the correlations of the data with the target variable are solid enough and the model is trained properly, i don't see why it would not work. However, having a large variability in the gaps might induce a large amount of unnecessary/unlearnable noise. However, handling the specifics of induced noise etc, might require a separate question on this site. Because that would require a lot more information about the distributions of the data etc. $\endgroup$ Commented Apr 14, 2023 at 11:24
  • $\begingroup$ Thanks! If you have any related keywords, I'd be grateful for the orientation. $\endgroup$ Commented Apr 14, 2023 at 11:25
  • 1
    $\begingroup$ The type of time-series data you are using is called 'irregular time-series data'. Not sure if that might help in your future searches, but it might. $\endgroup$ Commented Apr 14, 2023 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .