A machine learning library in Python.
fit()transform()fit_transform()
Use fit() to train(learn) from a Dataset and then use transform() to test(estimate)
from sklearn import RandomizedPCA
tmp = RandomizedPCA(n_components=3) # Generate a PCA object.
tmp.fit(trainData) # Fit the PCA object to a trainset.(Training)
tmp.transform(trainData) # Transform the PCA object, which were fitted to the trainset, to the trainset again.
# (Estimation)
# It can be executed at once.
tmp.fit_transform(trainData)