title: sklearn StratfiedShuffleSplit
body: <p>Can someone help me understand what StratifiedShuffleSplit does? I am new to this library. I understand the principle behind stratfied sampling however in terms of code what exactly does the StratifiedShuffleSplit function return? </p>
  
  <p>The book I am reading has the following code, however I am not quite following.. Does the function actually add an index on the dataframe that distinguishes between test vs training, which is why they are then using .loc? And what exactly is it splitting the income_cat column by? Thanks!</p>
  
  <pre><code>from sklearn.model_selection import StratifiedShuffleSplit
  
  split = StratifiedShuffleSplit(n_splits=1, test_size=0.2, random_state=42)
  
  for train_index, test_index in split.split(housing, housing["income_cat"]):
      strat_train_set = housing.loc[train_index]
      strat_test_set = housing.loc[test_index]
  </code></pre>