1
$\begingroup$

I have one doubt like is it better to perform label encoding and check for the correlation or should I 1st perform correlation and do label encoding? Because when I tried it both ways I'm getting different features

$\endgroup$
0
$\begingroup$

Correlation is for continuous variables, example Pearson co-relation. Using Pearson correlation for categorical or ordinal variables are not recommended. If you are encoding the data, i can imply that it is a categorical variable. For categorical variables you can find association between the variables (instead of correlation) using Chi-squared test of independence. This test is quite lenient , in the sense, even for a weak association it will show a low p-value. To further validate the result of Chi-squared test of independence , you can calculate Crammers V-test which will give a specific value between 0 and 1 . The analysis gets easy with Crammers V-test. Crammers V-test uses Chi distribution. Whether you calculate association before or after the encoding (for categorical variable) it will not make any difference because it works on the frequency table rather than the actual values of the column

| improve this answer | |
New contributor
Amar nayak is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
0
$\begingroup$

1. It will not change unless you assume a new type for the Feature after Encoding i.e. Label encoding doesn't make a categorical data Continuous

2. Different pairs of feature types require different methods. The defacto Pearson coeff is for Continuous-Continuous feature.Similar read - DS.SE

3. Values coming out from two different types of Correlation method are not directly comparable i.e. 0.75 of Pearson doesn't mean the same strength as 0.75 from Crammer's V

| improve this answer | |
$\endgroup$

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.