However, on the internet, I've seen only examples with decreasing nm matrixes dimension to (for example) n1. I don't know if applying this algorithm to just a one-dimensional array is a good approach, I haven't found any example of that.
You are not applying PCA to one dimensional array. You are applying it to 2D matrix, 1500 x 5236 and reduce it to 1500 x 200; this is exactly what you see online -> 2D matrix reduced to smaller feature space. Tutorials online will often do so in an extreme fashion (e.g. to 1500 x 2) because one of the main uses of PCA is data visualisation and plotting anything beyond 2dims is ... hard ;)
Should I instead reshape each image back into the matrix, and then apply PCA on it?
No, there seems to be a confusion to what the matrix is. Your entire data is the matrix, if you were to have pictures you would end up with 3d tensor, not a matrix. PCA, as traditionally defined, cannot be applied to anything but a 2D matrix.
Or just left it as it is? Is it a good approach at all? Maybe there are some alternatives for PCA in my case?
PCA is just a heuristic regularisation technique. You are removing information from your data, to avoid overfitting. There is absolutely no guarantee it will work or help. And there are many many other regularisation techniques one can try:
regularisation losses, e.g. weight decay
regularistaion in network itself, e.g. dropout
regularisation in the data itself, e.g. "data augmentation" (training on slight transformations of your pictures that does not affect the final label, e.g. rotations etc.)
regularisation in the way loss is specified, e.g. through soft labels or mixup.
发布评论
评论(1)
您没有将 PCA 应用于一维数组。您将其应用于 2D 矩阵,1500 x 5236 并将其减小到 1500 x 200;这正是您在网上看到的 ->二维矩阵缩减为更小的特征空间。在线教程通常会以一种极端的方式进行(例如达到 1500 x 2),因为 PCA 的主要用途之一是数据可视化,并且绘制任何超过 2dims 的内容都是......很难;)
不,矩阵是什么似乎令人困惑。你的整个数据就是矩阵,如果你有图片,你最终会得到 3d 张量,而不是矩阵。按照传统定义,PCA 只能应用于二维矩阵。
PCA 只是一种启发式正则化技术。您正在从数据中删除信息,以避免过度拟合。绝对不能保证它会起作用或有帮助。还有许多其他正则化技术可以尝试:
You are not applying PCA to one dimensional array. You are applying it to 2D matrix, 1500 x 5236 and reduce it to 1500 x 200; this is exactly what you see online -> 2D matrix reduced to smaller feature space. Tutorials online will often do so in an extreme fashion (e.g. to 1500 x 2) because one of the main uses of PCA is data visualisation and plotting anything beyond 2dims is ... hard ;)
No, there seems to be a confusion to what the matrix is. Your entire data is the matrix, if you were to have pictures you would end up with 3d tensor, not a matrix. PCA, as traditionally defined, cannot be applied to anything but a 2D matrix.
PCA is just a heuristic regularisation technique. You are removing information from your data, to avoid overfitting. There is absolutely no guarantee it will work or help. And there are many many other regularisation techniques one can try: