In scikit-learn, all estimators have a fit()
method, and depending on whether they are supervised or unsupervised, they also have a predict()
or transform()
method.
I am in the process of writing a transformer for an unsupervised learning task and was wondering if there is a rule of thumb where to put which kind of learning logic. The official documentation is not very helpful in this regard:
fit_transform(X, y=None, **fit_params)
Fit to data, then transform it.
In this context, what is meant by both fitting data and transforming data?