title: Handling categorical values in tuples to be predicted
body: <p>I am building an API with a trained sklearn model. I have saved the model in .joblib format and I am loading it in the API backend before making predictions. But the problem is that my data contains categorical columns and I trained my model after one-hot-encoding these categorical columns using the <code>get_dummies()</code> method in the <code>pandas</code> library. My API receives JSON data with the values for the categorical columns without any encoding. How should I encode the tuple to be predicted before passing it through the model? Can anybody help me with this? Thank you.</p>
  
  <p>The dataset I'm using has the following set of columns before and after encoding:</p>
  
  <p><strong>Before:</strong></p>
  
  <pre><code>Index(['age', 'sex', 'cp', 'trestbps', 'chol', 'fbs', 'restecg', 'thalach',
         'exang', 'oldpeak', 'slope', 'ca', 'thal'],
        dtype='object')
  </code></pre>
  
  <p><strong>After:</strong></p>
  
  <pre><code>Index(['age', 'sex', 'trestbps', 'chol', 'fbs', 'restecg', 'thalach', 'exang','oldpeak', 'ca', 'cp_0', 'cp_1', 'cp_2', 'cp_3', 'thal_0',
         'thal_1', 'thal_2', 'thal_3', 'slope_0', 'slope_1', 'slope_2'],
        dtype='object')
  </code></pre>