I've been playing around with the linear regression, and I was thought that before commencing it's always good to plot an heatmap to see whether there are features that somehow is worth testing for their significance/relationship. Would you agree with the above?

With that being said, after having refined a tiny bit my data, I obtained the following heatmap:

enter image description here

As you can see I now have two features completely blank. I though in the beginning to some sort of rendering glitch, which is not the case.

In reviewing the dataset, I found out that the features have always the same value across the dataset.

I'd assume this is not being printed out due to the fact this feature has became statistically significant for every feature.

Would you say this is a correct way of referring to this? Or is there any other way to express this concept?

This is however not the case for the other feature, which contains a mix of numerical value, hence I'm not able to explain.

Can you please advice?

  • $\begingroup$ Hi, what tool did you use to derive the heatmap? And what is the empirical distribution of H1_2_Len values? $\endgroup$
    – Jonathan
    Commented Feb 16, 2020 at 17:08
  • $\begingroup$ Tool wise, I've been using Python as a coding language. The plot was spitted out by seaborn to which I gave a dataframe containing all the features in the graph. That sais, I just realised that I queries the wrong variable. The h1_2_len is always 0, so basically the same issue for the other variable. Would you say that the statements in my questions are correct? $\endgroup$ Commented Feb 16, 2020 at 17:26
  • $\begingroup$ @Sammy also, as I'm fairly new to this "game" can you explain how the empirical distribution would have helped? $\endgroup$ Commented Feb 16, 2020 at 17:28
  • $\begingroup$ I meant something like a histogram or binned histogram to see what the range and frequency of values is to see how much information the predictor carries. $\endgroup$
    – Jonathan
    Commented Feb 16, 2020 at 17:54

1 Answer 1


Since the variables isPWKinText and H1_2_Len have the same value for all examples in your dataset they have zero variance and contain no information. There is simply just no inference you can make based on them. That is why they are not relevant and shown blank.

Please note, that this depends on your dataset, of course. The two variable might just be constant for the examples you are currently looking at. For example, if this is an analysis of your training data maybe your datasplit is just really bad and the validation or test set contains examples for which these variable do show other values. That is something I suggest to double check.

  • $\begingroup$ Thanks for detailing your answer. Let me ask you something. When I have a categorical variable that I need to transform into numerical, what is the best approach? Say I have A to E, when in real life A is higher than E, would giving A = 1 the best approach or should that be A = 5? Similar to numerical values where magnitude is flipped, for instance 100 is worse than 1, should I swap the values? $\endgroup$ Commented Feb 17, 2020 at 7:29
  • $\begingroup$ @AndreaMoro whether numerical encoding makes sense depends on the task you are working on. It not only implies an order but also, for example, equidistance (e.g. the distance between A and B is the same as for B and C; A being 5 times better than D etc). this article might be of interest for you. $\endgroup$
    – Jonathan
    Commented Feb 18, 2020 at 8:28

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.