What is Stratify in train_test_split? With example - Dragon Forest

#artificialintelligence 

To spit data into a training set and test set, you had indeed used the train_test_split library from scikit learn. There are some parameters in train_test_split like random_state, stratify, shuffle, test_size, etc. Here we will talk about one parameter called stratify in train_test_split in a simple way. Basically, we use stratify to create an unbiased dataset when you have a biased dataset. Suppose we have data and if that data is biased then we can have to use stratify to overcome train_test_split's biased random sampling problem.