0
$\begingroup$

I have a large dataset, where I should make a binary prediction. The fact is that, after analyzing the data, I found that some variables are positively correlated to each other. So, I was wondering whether I have to delete some variables and keep the others(i.e if A and B are correlated, should I delete A and leave B in the data) to continue the process or What is the best way to deal with this kind of problem ?

$\endgroup$
1

2 Answers 2

1
$\begingroup$

It depends. If you are using this data on a linear model it is better to remove correlated features. But some non-linear complex model can use or eliminate these correlated feature automatcially.

$\endgroup$
1
  • $\begingroup$ Thank you for your help. $\endgroup$ Commented Oct 8, 2021 at 5:09
0
$\begingroup$

Yes you have to remove one of them. For example when you plot a heatmap and notice that 2 features A and B have a correlation value of 0.91, remove one of them as removing both of them will lead to information loss.

After removing one of them, again plot a heatmap of the remaining features and you'll notice the correlation values of other features have changed. So it is an iterative process. Now lets say you have 4 correlated features A, B, C and D. Instead of removing 2 of them, first remove one (either A or B) and then again plot the heatmap. If C and D are still correlated, only then remove either of them.

$\endgroup$
2
  • $\begingroup$ There must be a confusion here: the correlation between 2 variables doesn't depend on any other variable, so it's impossible that the correlation score between C and D would change after removing A or B. $\endgroup$
    – Erwan
    Commented Oct 8, 2021 at 2:22
  • $\begingroup$ Thank you for your help $\endgroup$ Commented Oct 8, 2021 at 5:09

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.