Splitting Data

How to prepare data for machine learning by defining data frames for target variables and input features, and using stratified random sampling to ensure training and testing sets are representative of the whole dataset.