To find best number of dimensions for PCA