简体   繁体   中英

What does fit, transform, and fit_transform do in PCA available in sklearn.decomposition?

I am trying to mimic the behavior of PCA class available in sklearn.decomposition .

I have wrote a method which computes the SVD but I am not sure what does fit() , tranform() , and fit_transform() do without which I'm not able to proceed further.

I think fit() computes the svd and the singular values can be accessed using the singular_values_ attribute but I don't know about the remaining two methods.

In the docs you can see a general explanation of fit() , transform() , and fit_transform() :

[...] a fit method, which learns model parameters (eg mean and standard deviation for normalization) from a training set, and a transform method which applies this transformation model to unseen data. fit_transform may be more convenient and efficient for modelling and transforming the training data simultaneously.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM