I want to cluster. I have different features for that. Some features have a very small value range (from 0 to 0.8) and some have a very large value range (from 0 to 5 million). I want to use the logarithm. Do I have to apply this feature transformation to all features, including the small values (shift the values before by +1) or can I just choose the features I want to do the transformation on? Is there any literature or work on this?


Either can be good or bad. It's not necessary to apply the same transformation to all attributes; but if youe attributes differ that much, you likely have some major problem anyway.

It depends on what you want to achieve what is appropriate. Try to approach it from having to explain your choices later. Can you argue why you transform the data this way? What is the statistical meaning of this transform for your problem? Here you'll quickly realize that with mixed data you can't really argue much - your results are based on guessing, not in a sound model.

  • $\begingroup$ First of all many thanks for your answer! But I have two more question. Wouldn't it be okay to say, I take the logarithm from the features with the large value range, because it is skewed data and the data even gets a smaller value range? Would that be not statistically correct? I want to get the data to the same value range, because it plays a role in the distance measurement of the cluster algorithm. Without transforming my data, the clusters aren't good. $\endgroup$
    – piku
    Dec 1 '19 at 7:31
  • $\begingroup$ A "large" value range itself is not a sufficient argument for a long scale. Skewedness is, if the data becomes less skewed afterwards. You may still need to adjust the range afterwards. Technically you will never really have the same value range though. $\endgroup$ Dec 1 '19 at 8:15
  • $\begingroup$ I really don't find any paper saying that feature scaling can only be applied to selected features. Do you have a tip for me? I'm not sure if I can only apply the log to the feature with the large value range and not to the feature with the value range 0 and 0.8 (or after the shift plus 1 --> 1 and 1.8). $\endgroup$
    – piku
    Dec 1 '19 at 9:10
  • $\begingroup$ You don't need to cite a paper. Obviously you can transform each column independently. But you should have good arguments for the transformation you choose, including that "shift". Why not sqrt instead? $\endgroup$ Dec 2 '19 at 0:01
  • $\begingroup$ I don't think it is that obvious and neither is my professor. My task is to find a paper, but I really don't find one. And that surprises me. $\endgroup$
    – piku
    Dec 2 '19 at 11:43

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.