I was thinking about it, but I couldn't find a logical explanation.

Mostly im following below steps after data become ready:

  • Correlation analysis and elimination
  • Apply dummy if categorical variables exist
  • Balance the data if data is unbalanced
  • Scale data
  • Feature selection (Backward, Stepwise etc.)
  • Train model

Where would the correlation analysis be applied for this path I followed would make more sense? After the data is balanced? After scaling? Or at first?

  • $\begingroup$ Your first step is "Correlation analysis and elimination", do you mean that you eliminate the features which have a low correlation with the target variable? If yes that would be part of the feature selection process, so I would probably do it around the same time as the other feature selection part. $\endgroup$
    – Erwan
    Feb 21, 2020 at 0:22
  • $\begingroup$ I did mean eliminate the features which are highly correlated with each other. If i do that in feature selection section, data will be balanced, scaled and transformed the dummy variables. So how much is it correct to perform correlation analysis after those sections? If i perform it on original dataset isin't it more logical? $\endgroup$
    – talatccan
    Feb 21, 2020 at 6:50
  • $\begingroup$ Imho I don't see any strong reason to do it one way or the other, but the result might be different: for instance 2 categorical variables might not be correlated but some of their "dummy" features might be. $\endgroup$
    – Erwan
    Feb 21, 2020 at 11:52

2 Answers 2


Correlation is a bivariate feature analysis technique.

Typically, that is done after univariate features analysis. But before any feature engineering.

Most machine learning is iterative so correlation can be revisited at any stage.


The correlation analysis should typically be performed before any other data preprocessing steps, such as balancing or scaling the data. This is because the correlation analysis is used to identify relationships between variables in the dataset, which can then be used to guide the selection of features and the development of the predictive model.

Performing the correlation analysis after scaling or balancing the data may result in a distorted view of the relationships between variables, as these preprocessing steps can change the distribution of the data. Therefore, it is generally recommended to perform the correlation analysis before any other data preprocessing steps.


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.