I am a newbie in ML, and I am learning how to fill missing data in a dataset using Imputer. These are the few lines of code that I came across
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis = 0)
imputer = imputer.fit(X[:, 1:3])
X[:, 1:3] = imputer.transform(X[:, 1:3])
Now I am not able to understand what is the role of the fit and the transform function. It will be great if someone can help. Thank you.