title: Encoding categorical variable that is a list of values
body: <p>I have the following data:</p>
  
  <pre class="lang-none prettyprint-override"><code>Rank    Platforms        Technology
  
  high    Windows||Linux   Unity
  high    Linux             
  low     Windows          Unreal 
  low     Linux||MacOs     GameMakerStudio||Unity||Unreal
  low                      GameMakerStudio
  </code></pre>
  
  <p>Both <code>Platforms</code> and <code>Technology</code>  are categorical variables. The issue here is they can have one, or Empty, or, especially multiple values like <code>GameMakerStudio||Unity||Unreal</code>. I am building a logistic regression model to predict <code>Rank</code> data.</p>
  
  <p>I am attempting to encoding these variables for my model. However, I have not found any solution for list-type categorical values. I have read this page <a href="https://kiwidamien.github.io/encoding-categorical-variables.html" rel="nofollow noreferrer">Encoding Categorical Variables</a> and found that One-hot encoding is the most closely related, but still does not address my issue.</p>
  
  <p>I could, of course, manually encode it. For example, there are around 7 distinct platform value for <code>Platforms</code> column, if <code>Platforms = Windows||Linux</code>, I could set 2 columns <code>is_windows = true</code> and <code>is_linux = true</code>. But for <code>Technology</code> column, there are 21 distinct values.</p>
  
  <p>Is there a way to encode it automatically?</p>