I am a beginner in Machine Learning. I have been inspecting some kernels at Kaggle. Some of these answers use factors in their predictive models while others split them into dummy variables (this happens especially when the code is written in Python). I am using R. Which approach is better?
It does not really matter. Factors are internally coded as Dummy variables in R. If you are not familiar with statistics and econometrics I suggest you to use factor variables (be sure that they are correctly coded with
I suggest you this because you may include all dummy variables in the model and cause multicollinearity. In addition to this, you do not have to bother about creating the dummy coding, you can save up some lines of code.
Hope this helps! Un saludo! ;)