What data sets should be used when calculating scalers? When doing maching learning tasks, it is common to divide the whold data set into three unoverlapping subsets, namely training set, validation set and test set. I understand that the test set should be excluded during the model developmet process and scaling is usually needed in the data pre-processing stage. However, I'm not sure which data sets should I use to calculate the scalers. Should I use scalers calculated from the training set or scalers calculated from both the training set and the validation set?

You should use scalers fitted on the training set, and use it on validation and test sets. But, if you refit using train+validation after your validation loops (e.g. for HPO), you should use scalers fitted on train+validation and use it on the test set.
