Miraikei
2/16/2020 - 7:38 PM

Random Sampling to Create Test Set

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)