Random sample before or after data transformation I have a very basic model development question. 
The objective is to develop a predictive model. Let's say I have a dataset with 50,000 observations.
Take a random split of this dataset into train (N=25000) and validation (N=25000) datasets (we know some folks prefer a test dataset but assume we are not going to do that for now).


*

*Should I transform (binning, any scaling, creating dummy variables, declaring factors etc.) the original raw dataset and then take the random sample for train and validation datasets? 
OR 

*Should I apply data transformation to the train set first and then apply the data transformation schemes learned from train set to the validation set?
Binning can differ if applied to the raw dataset as compared to train set if we are trying to use supervised binning algorithms like chi-merge or other optimization algorithms.
 A: This is a good question, although, @PeterFlom, has a very valid point that you may or may not consider. 
Nevertheless, if you have to choose between these two options (#1 - binning prior to randomly partitioning the dataset into a training and validation set or #2 - binning the training dataset and assessing its predictive ability (or lack thereof) with the validation dataset), option #2 makes more sense. 
The validation set, since you do not have a testing set, should be reserved for final assessment of the model built on the training set to compare its effectiveness. We would hope and expect that the model would perform equally, or close to equally, as well on the validation set as it does on the training set as each of these datasets should be a random partition extracted from the full dataset.
Additionally, if we chose option #1 (binning prior to randomly partitioning the dataset into training and validation sets), we run the risk of overfitting our model as we have no way of validating the effectiveness of the bins that we created if we use all of our data to decide upon the most appropriate bins for use in our final model.
Again, take note of Peter and Frank's reference in regards to binning and best of luck!
