0
$\begingroup$

Is there any benefit to combining similarly named columns either for an improvement in accuracy or for speeding up training/prediction in case of logistic regression, random forest or neural network models?

I have seen this done at times but wasn't sure if there was more than a heuristically-motivated reason for doing it.

eg. Converting this:

name col1 col2 col3 time
gina 5 12 20 30
john 6 7 43 40

to this:

name (col1,col2,col3) time
gina (5,12,20) 30
john (6,7,43) 40
$\endgroup$

1 Answer 1

1
$\begingroup$

What you are talking about is called feature engineering. Basically it is done to reduce the dimensionality of the dataset. What we are doing is combining 2 or more features which provide the same info, into one feature.

For example I had this dataset where I had to predict the price of a used car. There were 2 features month of registration and year of registration. So I combined the into 1 feature called age of car. That way I reduced 1 dimension of my dataset.

Keep in mind that this is mostly done for numerical features and not for categorical ones. Doing this for categorical features will result in textual dataset which will need NLP.

$\endgroup$
5
  • $\begingroup$ Thanks! On doing this combination, we now have a resultant tuple. How is that handled by common classification algorithms? As far as I understand, we like to split combined data into scalar values for ease of computation (through methods such as one hot encoding). This is the reverse process. $\endgroup$
    – v81
    Oct 14, 2021 at 18:18
  • $\begingroup$ Secondly, is there a benefit to combining these features? $\endgroup$
    – v81
    Oct 14, 2021 at 18:18
  • $\begingroup$ Once we combine the 2 features into 1, we do not encode that feature. Remember we are combining numerical features and not categorical features, and hence they do not need encoding. Only categorical features need encoding. $\endgroup$
    – spectre
    Oct 15, 2021 at 4:47
  • $\begingroup$ As to your second comment, as I mentioned in the answer, one advantage is that it can reduce the dimensionality of the dataset which usually helps in the performance of the model. $\endgroup$
    – spectre
    Oct 15, 2021 at 4:48
  • $\begingroup$ So how does an algorithm treat this combined numerical tuple that could look like this: (5,2,3,1)? $\endgroup$
    – v81
    Oct 18, 2021 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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