Medical Data Visualizer. Issue with answer

Answers to the medical-data-visualizer problem seem wrong.

Although I have completed the code and have good output I cannot reconcile my output with the final test in function test_heat_map_labels(self). I am beginning to wonder if the test itself might have some issues.
I apologize in advance if I am missing something.
Please advise.
Many thanks.

(1) In we have an error message referring to "month of the year.
This undermines my trust in the answer.
def test_heat_map_labels(self):
actual =
for label in
expected = [‘id’, ‘age’, ‘gender’, ‘height’, ‘weight’, ‘ap_hi’, ‘ap_lo’, ‘cholesterol’, ‘gluc’,
‘smoke’, ‘alco’, ‘active’, ‘cardio’, ‘overweight’]
self.assertEqual(actual, expected, “Expected bar plot legend labels to be months of the year.”)

(2) In folder “Examples” file Figure_2" See attached below.
The heatmap, does not seem correct.
(a) Variable "weight’ is NOT part of the answer which seems wrong.
(b) Variable “ID” IS part of the answer which makes no sense statistically.
An internal record key does not relate to the variables or the application.
It’s like asking for the average of a list of Social Security numbers.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36

Challenge: Medical Data Visualizer

Link to the challenge:

I’ll bet that it’s a copy/paste typo. Some of the other projects test for axis labels of months. Sounds like a good candidate for a pull request.

weight is in the heatmap; I’m not sure what you mean that it’s not part of the answer. I used that data to generate my heatmap. But as for id, you rightly say that it’s not related to anything so that makes it a good comparison for variables that do relate for people that are new to correlations and heatmaps. Since id does not actually influence any of the measured variables, then the expectation would be that id would have a correlation of zero with every variable. It does. If you want to see two variables that are strongly correlated, you need only look at the correlation value of weight and overweight on the heatmap. So yes, id is not related but it has some pedagogical value.

Now what is surprising is that in this dataset, high blood pressure and activity do not correlate with the other variables. Or that height and smoking correlates.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.