- 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 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1094065/image.png)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1094070/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1094075/image.png)
댓글 수: 0
답변 (1개)
Aman
2023년 9월 11일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!