Questions tagged [principal-components]

Performs a principal components analysis on the given data matrix and returns the results as an object of class prcomp.

The princomp( ) function produces an unrotated principal component analysis.

Performs a principal components analysis on the given data matrix and returns the results as an object of class prcomp.

32 questions
68
votes
2 answers

Principal components analysis using pandas dataframe

How can I calculate Principal Components Analysis from data in a pandas dataframe?
14
votes
6 answers

What does "argument to 'which' is not logical" mean in FactoMineR MCA?

I'm trying to run an MCA on a datatable using FactoMineR. It contains only 0/1 numerical columns, and its size is 200.000 * 20. require(FactoMineR) result <- MCA(data[, colnames, with=F], ncp = 3) I get the following error : Error in…
VeilleData
  • 275
  • 1
  • 2
  • 10
4
votes
1 answer

Principal Component Analysis using libpca

libpca is a C++ library for Principal Component Analysis that builds upon Armadillo, a linear algebra library. I am having a problem with it, though. I am comparing its output with the example given by Lindsay Smith in his great tutorial on PCA.…
kunterbunt
  • 614
  • 1
  • 7
  • 19
3
votes
1 answer

Principal component analysis vs feature removal

I'm quite new to machine learning and just got introduced to principle component analysis as a dimensionality reduction method. What I don't understand, in which circumstances is PCA any better than simply removing some features from the model? If…
Botond
  • 2,640
  • 6
  • 28
  • 44
3
votes
1 answer

Extracting useful information from K-Means on Principal Components

I am working with a relatively big data set (only using about 1/32 of it, but this subset is approx. 50000x9000). In order to perform analysis on this, I have taken several steps to reduce the dimensionality, so that I can then apply some sort of…
Boudewijn Aasman
  • 1,236
  • 1
  • 13
  • 20
3
votes
1 answer

Calculating and Plotting Principal Components using Principal Component Analysis (PCA) in Matlab

I have an image. I need to identify the axis along which the variance of the image is the smallest. A bit of reading and searching led me to the conclusion that Principal Component Analysis(PCA) is the best alternative. Can anyone help me with…
user2307268
2
votes
1 answer

Scikit-learn PCA .fit_transform shape is inconsistent (n_samples << m_attributes)

I am getting different shapes for my PCA using sklearn. Why isn't my transformation resulting in an array of the same dimensions like the docs say? fit_transform(X, y=None) Fit the model with X and apply the dimensionality reduction on…
2
votes
0 answers

Principal Components for categorical Variables

I have data that contains both continuous and categorical variables. I want to find principal components as one can find using prcomp function (in R) for continuous variables. I've seen the function MFA in the FactoMineR package. I grouped all…
sandep
  • 31
  • 4
2
votes
1 answer

OpenCV Principal Component Analysis terminology - what actually is a 'sample'?

I'm working with Principal Component Analysis (PCA) in openCV. The constructor inputs for the case I'm interested in are: PCA(InputArray data, InputArray mean, int flags, double retainedVariance); Regarding the InputArray 'data' the documents state…
Lamar Latrell
  • 1,669
  • 13
  • 28
2
votes
2 answers

Interpreting first few PCA components for handwritten digit recognition

So in Matlab I perform PCA on handwritten digits. Essentially, I have say 30*30 dimensional pictures, i.e. 900 pixels, and I consider after PCA the components which capture most of the variance, say the first 80 principal components(PC) based on…
1
vote
0 answers

Complex numbers in principal components, with symmetric correlation matrix

After running a PCA with real-valued data and a symmetric correlation matrix I'm getting back complex numbers in the principle components. When I do random sampling on the underlying data I see that sometimes the principal components are real-valued…
1
vote
0 answers

Is there a relation between factors in FA method?

I am doing a factor analysis on my data set (I have 85 attributes and data available for 20 participants), I have decide to use 19 attributes to cover 98 % of the variation, but my result with 19 factors made me a bit confused. I have plot the…
1
vote
1 answer

Principal component analysis using sklearn and panda

I have tried to reproduce the results from the PCA tutorial on here (PCA-tutorial) but I've got some problems. From what I understand I am following the steps to apply PCA as they should be. But my results are not similar with the ones in the…
joh
  • 53
  • 2
  • 8
1
vote
1 answer

Using Principal Component Analysis (PCA) for feature reduction (HOG-PCA)

Using Histogram of Ordered Gradients (HoG) I have computed features of 15 sample images. The feature vectors generated by these samples are very large (i.e. take up a lot of memory). To reduce these feature vectors, i am using Principal Component…
1
vote
2 answers

Principal component analysis using "Principal"

I am using principal() function from psych package to replicate SPSS principal component analysis results in R. (as recommended in: https://stats.stackexchange.com/questions/612/is-pca-followed-by-a-rotation-e-g-varimax-still-pca) I'm using the…
Tiffany
  • 11
  • 1
1
2 3