If I want to extract the features from a time series data of say 2000 samples, then I should convert this dataset into an input vector of dimensions n*k, then on what basis I should select n and k?
I am not sure if we understand your question correctly. Are you asking for the right amount of principals components?
An easy, but comprehensive and well visualized tutorial on PCA can be found here http://www.sthda.com/english/articles/31-principal-component-methods-in-r-practical-guide/112-pca-principal-component-analysis-essentials/ .
You run PCA with a data frame (rows being samples, columns being parameters). With the help of the eigenvalues and the scree plot, you can decide how many principal components to include.
It depends what you are using the result for, and how many dimensions you think should account for the interesting variation in the sample.
As previous commentators note, if you have no thoughts about these two aspects, the eigenvalues of the correlation matrix can offer clues. If you're data are X and you are using R, try
plot(1:ncol(X),eigen(cor(X))$values)
and look up scree test for how to interpret this. But first think about those first two things.
Thanks, but I am not asking for right amount of principal components.
I am asking to reconstruct the input vector, i.e. if I have an input sequence of 2000x1 and I want to apply the PCA over it then to do so I should first convert it into on input vector of dimention n*k which after applying PCA depending upon variation is converted to an output vector of dimention n*s (s being lesser than k).
Then is there any criteria to select n and k or any combination of n*k should be selected randomly ?
Maybe it's easiest if we start with a minimal working example.
If we follow this easy tutorial: http://www.sthda.com/english/articles/31-principal-component-methods-in-r-practical-guide/112-pca-principal-component-analysis-essentials/ we can simply do:
library(factoextra)
library(FactoMineR)
data(decathlon2)
decathlon_active print(res)
**Results for the Principal Component Analysis (PCA)**
The analysis was performed on 23 individuals, described by 10 variables
*The results are available in the following objects:
Let me see if I understand. You have a single vector, length 2000, and you want to reduce this in some way. I assume you are expecting some pattern. Are you expecting PCA to find this pattern?