I use a classification model on time-series data where I normalize the data before splitting the data into train and test. Now, I know that train and test data should be treated separately to prevent data leaking. What could be the proper order of normalization steps here? Should I apply steps 1,2,3 separately to train and test after I split data with the help of a sliding window? I use a sliding window here to compare each hour (test) with its previous 24 hrs data (train). Here is the order that I am currently using in the pipeline.
- Moving averages (mean)
- Resampling every hour
- Split data into train and test using a sliding window (of a length 24 hrs (train) and slides every 1 hr (test))
- Fit the model using train data
- Predict using the test data