Cross Validated Asked by iuppiter on January 5, 2022
I have time series data and am fitting a (LSTM) neural network. The time series data include let’s say a brain wave (var1) as well as the previous state (prev_state) and I want to predict a state (y_pred) based on the data and values over several steps before. The problem I run into is I can fit a neural network, or any type of model, on the training data but the training data already has all the correct state values; but when predicting one record at a time over the same training data everything gets thrown off and the model can get stuck in one state because a state prediction is used as input to the next record.
For example:
Training Data:
Var1 prev_state y_true
22.2 1 0
20.1 0 1
25.1 1 1
28.5 1 1
30.0 1 1
Predicting not one a time but with already states known:
Var1 prev_state y_pred
22.2 1 0
20.1 0 1
25.1 1 0 (HERE THE MODEL MADE THE WRONG PREDICTION BUT IT'S OK BECAUSE THE TRAINING DATA ALREADY KNOWS THE TRUE STATE IN THE NEXT RECORD)
28.5 1 1
30.0 1 1
Predicting one at a time and then inserting the prediction in the input of the next record:
Var1 prev_state y_pred
22.2 1 0
20.1 0 1
25.1 1 0 (HERE THE MODEL MADE THE WRONG PREDICTION AND IN THE NEXT RECORDS ENTIRE PREDICTION SEQUENCE GETS THROWN OFF)
28.5 0 0
30.0 0 0
Is this a problem with over or under fitting? Not sure how to approach this. I’m wondering if the setup is just plain wrong and I’m wasting my time.
There are two ways to approach your problem:
Answered by Skander H. on January 5, 2022
0 Asked on January 28, 2021 by chua-s-yang
0 Asked on January 28, 2021 by visionenthusiast
0 Asked on January 28, 2021 by zqq
lasso machine learning mathematical statistics ridge regression self study
1 Asked on January 28, 2021 by nlapidot
0 Asked on January 28, 2021 by tricostume
1 Asked on January 27, 2021 by mathews24
0 Asked on January 26, 2021 by thecity2
2 Asked on January 26, 2021
0 Asked on January 26, 2021 by bonesones
0 Asked on January 26, 2021 by kplauritzen
2 Asked on January 26, 2021 by user369210
0 Asked on January 26, 2021
causality confounding difference in difference econometrics panel data
1 Asked on January 25, 2021 by kiril-e-proykov
0 Asked on January 24, 2021 by oja-niva
classification machine learning random forest recommender system regression
0 Asked on January 24, 2021 by mephisto73
0 Asked on January 23, 2021 by valjean
1 Asked on January 23, 2021 by tjt
5 Asked on January 23, 2021 by user239903
0 Asked on January 21, 2021 by pooza
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP