I have a data set with more than 20 features, and I applied PCA:
M.fit_transform(all_data)
variance = M.explained_variance_ratio_
var = np.cumsum(np.round(M.explained_variance_ratio_, decimals=3)*100)
plt.ylabel('% Variance Explained')
plt.xlabel('# of Features')
plt.title('PCA Analysis')
plt.ylim(30,102.5)
plt.plot(var, marker="s")
plt.show()
Printing the var
variable, I get
array([ 89., 100., 100., 100., 100., 100., 100., 100., 100., 100.])
I understand this tells us that the variance is explained by 2 features.
So I calculated it again, now the 2 components:
from sklearn.decomposition import PCA
M = PCA(n_components = 2)
X = M.fit_transform(all_data)
plt.scatter(X[:,0],X[:,1])
And this gives a "random looking plot". I understand that the data was changed during the PCA process.
What can I do with this information? How will this help me understand the data?
Is it useful per se? Is it useful as a preparation method for other methods? Which ones can I try?