How to classify using PCA ("pcares" function)

5 Ansichten (letzte 30 Tage)
Kong
Kong am 28 Mär. 2020
Bearbeitet: Shantanu Dixit am 16 Jan. 2025
Hello.
I want to do a video classification.
I found some function about PCA.
[residuals,reconstructed] = pcares(X,5)
After using pcares(X,5), Can I classify data using "reconstructed"?
I mean, "reconstructed" is 3600 x 25.
1. After flattening each data, I got 90000 X 1.
2. I have 90 data, so I got 90 X 90001 (the last column is class).
3. Using classification methods like SVM, KNN, etc.
4. calculate the accuracy of the classification.
Is it a reasonable approach? or do I need to use other methods as PCA not "pcares".
When I use "reconstructed" data after "pcares", the accuracy of classification is so low.
Please let me know how to deal with this issue.

Antworten (1)

Shantanu Dixit
Shantanu Dixit am 16 Jan. 2025
Bearbeitet: Shantanu Dixit am 16 Jan. 2025
Hi Kong,
The approach for using "pcares" function for classification seems reasonable, but there are some things to consider when using "pcares" for the use case of video classification, especially if you're getting low accuracy after classification.
[residuals,reconstructed] = pcares(X,ndim)
The 'reconstructed' data represents an approximation of your original data using the top 'ndim' principal components. If too few components are used (e.g., 5), some significant variance and important features might be lost. For this purpose you might need to increase the number of components to retain enough information.
Spatial and Temporal Structure: Also flattening the reconstructed data into 1D vectors may discard spatial and temporal relationships, which are important in video data. For 2D or 3D data (like video), it's often better to preserve these relationships, as they are critical for accurate predictions.
You can experiment by increasing the number of components to capture more variance. You could also consider using "pca" (without the residuals) to retain the most important features. Additionally, for better preservation of spatial features, you can consider using 'convolutional neural networks': https://www.mathworks.com/help/deeplearning/ug/introduction-to-convolutional-neural-networks.html
Hope this helps!

Kategorien

Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by