1
$\begingroup$

a newbie here. I am currently self-learning data science. I am working on a dataset that has both categorical and numerical (continuous and discrete) features (26 columns, 30244 rows). Target is numerical (1, 2, 3). I have several questions.

  1. I still have not performed any encoding or scaling techniques. According to my knowledge, as my categorical data are unordered, I have to perform one hot encoding right? As it will increase the number of columns, I am hoping to do that after feature selection. Is that okay?

  2. How can I perform feature selection for this dataset? (Because this has both numerical and categorical data) Should I first do one-hot encoding and then go for checking correlation or t-scores or something like that?

(I am currently focusing on EDA only. I don't have a model in my mind)

Any help is much appreciated. Thank you!

$\endgroup$
2
  • $\begingroup$ Do let me know if you are satisfied with the answer? If not I will try my best possible way to edit it. Please consider accepting the answer if it answers your question. $\endgroup$ Jun 3 at 15:14
  • 1
    $\begingroup$ Hi @DevashishPrasad thank you for taking your time answering and I am satisfied with your answer as it cleared many of my doubts :) $\endgroup$
    – leahnanno
    Jun 3 at 20:14
0
$\begingroup$

I have to perform one hot encoding right?

Yes

As it will increase the number of columns, I am hoping to do that after feature selection. Is that okay?

No, you should do basic preprocessing like dealing with missing values and then proceed for handling categorical data before feature selection. Beware of nominal vs ordinal features.

How can I perform feature selection for this dataset?

There are many ways to perform feature selection. You can use the methods you mentioned as well many other methods like -

  1. L1 and L2 regularization
  2. Sequential feature selection
  3. Random forests
  4. More techniques in the blog

Should I first do one-hot encoding and then go for checking correlation or t-scores or something like that?

There is a great answer on this issue here.

$\endgroup$
4
  • $\begingroup$ Thank you for your answer! $\endgroup$
    – leahnanno
    May 30 at 19:26
  • $\begingroup$ @leahnanno, your welcome, if it answers your question then you can accept the answer :) $\endgroup$ May 31 at 7:00
  • $\begingroup$ I think your answer needs further clarification on correlation treatment for categorical variables. I think your knowledge on categorical data is limited. Take a look at Agresti book on categorical data analysis and you will realise how shallow is your knowledge. $\endgroup$
    – mnm
    May 31 at 13:33
  • $\begingroup$ Thanks for pointing that out @mnm. I will surely try to improve my answer. $\endgroup$ May 31 at 13:45

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.