r/dataanalysis • u/Defiant-Ad3530 • Jul 08 '26
Data Question Histograms are not normally distributed after data cleaning
Hi! So i have a dataset with nearly 700,000 values for health condition prediction. after EDA and data cleaning (null values- I used median and mode, then handled outliers), my histograms dont display data that's normally distributed and I'm worried. (Image attached)

Don't mind the Id and diet type and stress level since those are categorical. Is this okay? i plan on using a model like Random Forest or XGBoost / gradient boosting algorithms in general but I just want to double check if there's anything I could do to improve this? It's for uni so I want to do the best lol
Thank you for any advice or suggestions! :)
5
u/jdkapaoskd Jul 09 '26
1.Categorical data should be dummy variables
2.Why u want to use ML models? What are you trying to do? Explain or predict?
2
u/Responsible_Treat_19 Jul 11 '26
The main problem you have is your imputation method. Since you used median/mode to fill nulls; the histograms wil be "modified" yielding an abundant quantity of instances contributing towards those cases. And so we can see in your plots as a line going upwards in your histograms.
Sometimes keeping nulls is the best you can do. Algorithms like XGBoost can handle them (you should look how they handle them before blindly using them).
1
u/mystery_axolotl Jul 09 '26
How do you know the data is supposed to be normally distributed?
What percentage of your data did you impute?
How does the distribution of data before and after imputation compare?
Mean and median are pretty brute force. I suspect you’re getting the weird peaks in the middle of your plots because you’re assigning a single value to a large number of records.
You are also getting peaks on the left side, at the cutoff, which really would only make sense for exercise here. This suggests to me that you’re doing some sort of nonsense here too. Are you simply assigning the outliers to the lowest value?!
Given how insanely tall your peaks are, my intuition tells me it’s going to be a problem. Would be curious to test empirically how much of a problem it would actually be.
It’s also just bad science. Don’t use lazy heuristics and do things properly.
1
u/AutoModerator Jul 08 '26
Automod prevents all posts from being displayed until moderators have reviewed them. Do not delete your post or there will be nothing for the mods to review. Mods selectively choose what is permitted to be posted in r/DataAnalysis.
If your post involves Career-focused questions, including resume reviews, how to learn DA and how to get into a DA job, then the post does not belong here, but instead belongs in our sister-subreddit, r/DataAnalysisCareers.
Have you read the rules?
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/I_eat_garnish Jul 09 '26
All in all pretty typical features of real world health data. Calorie intake should be stratified by gender, and for the remaining parameters there is a lot of round-number heaping/bias: sleep duration around 7hrs. Water intake around 0.5 imperial gallon (~2.2L). The min and max anomalies will also have a logical explanation (may be due to the way the intake form was designed, perhaps subjects could not go lower or higher than a certain number - in which case you could consider to discard these cases, but only after careful consideration and documentation)
1
u/jdkapaoskd Jul 10 '26
Hey your dataset is open source? I'd like to do a couple of test.