I am very confused about the data that feeds to Kmean and PCA algorithm using Scikit Learn command in Python. I searched a lot in the internet but no where I found the clear answer.
I have $X$, a $m \times n$ matrix where $m$ is the number of samples and $n$ is number of features. For example consider the matrix to be $20 \times 10$ where we have $20$ different people with $10$ different features like height, weight and so on.
kmeans = KMeans(n_clusters=2,init='random')
kmeans.fit(X)
I am using above command for the Kmean and following command for the PCA :
pca = PCA(n_components=2,svd_solver='full')
Xbar = pca.fit_transform(X)
Therefore I am feeding matrix X directly to the Kmeans and PCA (assume I already standardized the input). For the Kmeans I am not getting anything strange but when I print the Xbar as two principle components I have vector of 20*1 for each eigenvector. Shouldn't I get 2 eigenvectors of $10\times 1$ since the covariance matrix should be $10\times10$?
I would like to know is this the right of way expressing the input data meaning that should the rows of matrix be number of samples and columns be number of features?