title: How do I split a dataset into training and testing whilst retaining the proportions of binary data (i.e some drugs work some don't)?
body: <p>I have a dataset of drugs, associated chemical features and whether they are &quot;responsive&quot; or &quot;Unresponsive&quot;. I need to ensure that once I split the dataset into test and train they both have the same proportion of responsive:unresponsive. I know how to randomly split the data where training is 80% and test is 20%. Not sure how to do the stratified sampling necessary here, is this what I'm meant to use -  <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.StratifiedKFold.html" rel="nofollow noreferrer">https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.StratifiedKFold.html</a>?</p>