- If in your dataset the number of samples of one class is way too many compared to the other class, then there is a data imbalance in your dataset, which can be solved either by under-sampling the majority class or by oversampling the minority class.
- If there is less training data, then you need to perform data augmentation to increase the training sample size.
- If the range of data among the features varies too much, you need to pre-process the data to make them in the same range to ensure equal contribution of each feature. One way to do so is by using min-max scaling.
Using LSTM for time series classification, all data in the training set and the test set were erroneously classified into one class
2 views (last 30 days)
Show older comments
I wanted to use LSTM to do a two-class classification of time series, but in the end all the data was grouped into one class and my tags didn't seem to work
0 Comments
Answers (1)
Aman
on 11 Sep 2023
Hi 杰膑 罗,
I understand you want to perform a classification task on the time series data using LSTM.
Misclassification into a single class can occur for many reasons, like an imbalanced dataset, insufficient training data, improper data preprocessing, and training issues like not giving enough epochs to train the model.
These issues can be resolved using data balancing, data augmentation, and proper data pre-processing techniques. Please try the following steps to diagnose the issue:
Please refer to the following documentation to know more about performing classification on the time series data:
Hope this helps!
Regards,
Aman Mehta
0 Comments
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!