title: How to encode one or multiple categorical variables into one feature
body: <p>I am trying to train a machine learning model on some categorical data I have, however I am unsure how to encode it. If I have a table like the following, what is the best way to encode &quot;var_3&quot;?</p>
  <pre><code>| var_1 | var_2 | var_3                                             |
  |-------|-------|---------------------------------------------------|
  | 32    | 0     | 'attribute_1'                                     |
  | 15    | 1     | 'attribute_1,attribute_2,attribute_3,attribute_4' |
  </code></pre>
  <p>Is it a good idea to encode each &quot;attribute&quot; individually into an integer? Like the following:</p>
  <pre><code>| var_1 | var_2 | var_3 |
  |-------|-------|-------|
  | 32    | 0     | 1     |
  | 15    | 1     | 1234  |
  </code></pre>
  <p>Or is it better to encode each possible combination of attributes into an integer?</p>