Let's say I've found some outliers in a column in my dataset and have decided to remove them.
Should I do this before or after I split the dataset into train/test sets?
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.Sign up to join this community
If you decided to remove outliers. Please remove them before the split(even not only before a split, it's better to do the entire analysis(stat-testing, visualization) again after removing them, you may find interesting things by doing this).
If you remove outliers in only any one of train/test set it will create more problems. (EX: An outlier in train set may not be an outlier in combined/full set, also the model will have high variance if you do so)
I would agree with @rusiano. If you remove outliers before split, you are affecting test/validation data. Test data should be unspoiled.
Regarding @VenkateshGandi answer: "If you remove outliers in only any one of train/test set it will create more problems.". In this case, don't remove outliers. Removing outliers is not always useful.