Answers.Body: <p>What you are trying to accomplish is called sequence prediction. It takes in a sequence of data, and spits out a score (target variable).</p>
  <p>Time-series data is usually formatted as 3D arrays with shape <code>(batch size, sample length, data)</code>. So in your case, the data would be <code>(location, duration, date, user_id)</code>. 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.</p>
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T10:52:42.197Z
Answers.Text: 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.
Answers.UserDisplayName: Robin van Hoorn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T11:18:20.087Z
Answers.Text: 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?
Answers.UserDisplayName: LittleLulatsch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T11:24:26.150Z
Answers.Text: 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.
Answers.UserDisplayName: Robin van Hoorn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T11:25:44.110Z
Answers.Text: Thanks! If you have any related keywords, I'd be grateful for the orientation.
Answers.UserDisplayName: LittleLulatsch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T11:28:36.507Z
Answers.Text: 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.
Answers.UserDisplayName: Robin van Hoorn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-14T07:28:00.377Z
Answers.LastActivityDate: 2023-04-14T07:28:00.377Z
Answers.UserDisplayName: Robin van Hoorn
Body: <h1>Context</h1>
  <p>I'd like to build a regression model for this data to predict a user's test scores given their study habits.</p>
  <p>Basically, the variables are in two separate csv tables similar to the ones below. Eventually, I'd like to create a forecasting model.</p>
  <p>Training variables:</p>
  <ul>
  <li>Time series data of study habits (multidimensional: location, duration, date, user_id)</li>
  </ul>
  <p>Target variables:</p>
  <ul>
  <li>Test scores (scores, date, user_id)</li>
  </ul>
  <h1>Problem</h1>
  <ol>
  <li>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?</li>
  <li>Is there a term for temporally aligning data in a time series or techniques?</li>
  </ol>
  
Tags: <datasets><time-series><training-datasets>
Title: Creating a Dataset from Time Series Data
UserDisplayName: LittleLulatsch
ThreadText: # Creating a Dataset from Time Series Data
  
  (Asked by: username_0 on 2023-04-13)
  
  # 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?
  
  **Tags:** datasets, time-series, training-datasets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-14. Score: 1 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_0**: 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?  
  > **username_1**: 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.  
  > **username_0**: Thanks! If you have any related keywords, I'd be grateful for the orientation.  
  > **username_1**: 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.  
  
  ---
  
  