covartech / PRT

Pattern Recognition Toolbox for MATLAB
http://covartech.github.io/
MIT License
144 stars 70 forks source link

ok... why is PCA different for regression and classification objects #3

Closed samkeene closed 12 years ago

samkeene commented 12 years ago

consider:

data = rand(30,1000); ds = prtDataSetRegress(data)

pca = prtPreProcPca('nComponents',100); pca = pca.train(ds);

%%

ds1 = prtDataGenFeatureSelection pca = prtPreProcPca('nComponents',100); pca = pca.train(ds1);

They both warn, but the first one tells me my data dimension is 30, the second warning say 8. But the regess object, my number of features is 1000, and num samples is 30. The second, my number of features is 8 and my num samples is 800. So the 1st one should not warn, no? What is the difference here because its a regression object?

peterTorrione commented 12 years ago

Ah.

This has nothing to do with regress or class objects.

The max number of PCA components is always bounded by the min(size(x)). (Which is usually # features, but for 30x1000 is num Observations).

I clarified the warning text to not say "#features", to instead say min(size(x)) = %d

Should clear it up