I am new to machine learning. I am bit confused in preprocessing. Generally,
Scenario-1: I am splitting the dataset into train,test and validation and applying the transformations like fit_transform on train and transform on test.
Scenario-2: The other method is applying transformations on the entire dataset first and then split the dataset into train,test and validation. I am bit confused in choosing , dividing the data before preprocessing and feature engineering or after preprocessing and feature engineering. Looking for a nice answer with effects and casues.