from sklearn.model_selection import train_test_split # Assuming data is a DataFrame object from pandas train_set, test_set = train_test_split(data, test_size=0.2, random_state=42)