python - scikit learn PCA dimension reduction - data lot of features and few samples -


i trying dimension reduction using pca scikit-learn. data set has around 300 samples , 4096 features. want reduce dimensions 400 , 40. when call algorithm resulting data have @ "number of samples" features.

from sklearn.decomposition import pca  pca = pca(n_components = 400) traindata = pca.fit_transform(traindata) testdata = pca.transform(testdata) 

where initial shape of traindata 300x4096 , resulting data shape 300x300. there way perform operation on kind of data (lot of features, few samples)?

the maximum number of principal components can extracted , m x n dataset min(m, n). not algorithm issue. fundamentally, maximum number there are.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -