title: Is there any way to check whether IndextoString assigns the same values while using labels from StringIndexerModel
body: <p>I have spark dataframe with two target classes for column <strong>status(&quot;Placed&quot;,&quot;Not Placed&quot;)</strong>.</p>
  <p>I used <strong>StringIndexer</strong> to convert the above column to indices in a pipeline and executed it.</p>
  <blockquote>
  <p>str_indexer = StringIndexer(inputCol=status,outputCol=&quot;status_index&quot;).fit(df_train).transform(df_train)</p>
  </blockquote>
  <p><strong>It assigned these values - <strong>{0: 'Placed', 1: 'Not Placed'}</strong></strong></p>
  <p>used IndextoString to convert the prediction label generated from the RandomForest algorithm to String again and used the labels generated from the above StringIndexer(str_indexer)</p>
  <blockquote>
  <p>IndexToString(inputCol=&quot;prediction&quot;,outputCol=&quot;status&quot;,labels=loaded_model.stages[0].labels).transform(in_indexed)</p>
  </blockquote>
  <ol>
  <li>Is this the correct way to convert the indices back to strings?</li>
  <li>Does the above IndextoString assigns the same values i.e., 0 for &quot;Placed&quot; and 1 for &quot;Not Placed&quot; ?</li>
  <li>Is there any way to test whether IndextoString assigns the same values as StringIndexer</li>
  </ol>