Reputation: 896
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.
Upvotes: 0
Views: 6049
Reputation: 10709
In the docs you can see a general explanation of fit()
, transform()
, and fit_transform()
:
[...] a
fit
method, which learns model parameters (e.g. mean and standard deviation for normalization) from a training set, and atransform
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.
Upvotes: 3