I have the following data:

Rank    Platforms        Technology

high    Windows||Linux   Unity
high    Linux             
low     Windows          Unreal 
low     Linux||MacOs     GameMakerStudio||Unity||Unreal
low                      GameMakerStudio

Both Platforms and Technology are categorical variables and each row can have one, or multiple, or Empty value.

How do I go about building a logistic regression model that predict the Rank as high or low in R?

I am thinking to separate the variable into multiple Boolean variables: like is_windows = [true, false], is_mac = [true, false],etc... However, for Technology, there are about 21 unique values.


Use One Hot Encoding. Here a link to tutorial. It's in python, but you should get the idea. It's pretty basic stuff, so I guess it should be available in some R package.

| cite | improve this answer | |
  • $\begingroup$ Hi @Piotr Rarus, that works for variable that has one value a time. Not multiple values $\endgroup$ – hydradon Nov 18 '19 at 23:23
  • $\begingroup$ Not really. Consider technologies: GameMakerStudio, Unity, Unreal. Our record has all these values, so you just code it as [1, 1, 1]. You must be mistaking it for label encoding. $\endgroup$ – Piotr Rarus - Reinstate Monica Nov 19 '19 at 8:19
  • $\begingroup$ could you post a full working example? Thank you $\endgroup$ – hydradon Nov 19 '19 at 14:13
  • $\begingroup$ Check this $\endgroup$ – Piotr Rarus - Reinstate Monica Nov 19 '19 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.