Correcting Skewed Data with Scipy and Numpy

  Рет қаралды 9,430

AnalytiCode

AnalytiCode

Күн бұрын

Skewed data can adversely affect your analysis and machine learning models. In this video, I demonstrate five methods for cleaning skewed data using the NumPy and SciPy modules. The methods include taking the square root, cube root, fourth root, log, and Yeo-Johnson transform. I also showcase the effectiveness of each method by summarizing the skewness of the data after each transformation with a bar plot.

Пікірлер: 37
@marcom5873
@marcom5873 6 ай бұрын
First time I have seen your videos. This is genuinely a very good video. Very well explained and clear. I am subscribing. The music wasn’t off putting either!
@CJP3
@CJP3 6 ай бұрын
Thank you so much!!! I really appreciate it. If there’s anything you’d like to see just let me know!
@marcom5873
@marcom5873 6 ай бұрын
@@CJP3Sent you an invite on LinkedIn!
@officialscience101
@officialscience101 Жыл бұрын
the on-screen text is a great addition, Dr. P!
@CJP3
@CJP3 Жыл бұрын
🙏🏽, I’ll incorporate more in upcoming videos! Thanks for the feedback!
@metinunlu_
@metinunlu_ Жыл бұрын
Thank you for the video, subscribed! KZbin needs more quality content like this.
@MikitaRashetnikau
@MikitaRashetnikau 8 ай бұрын
Amazing video I like it's structure: motivation, overview with examples, practical advices Thanks!
@CJP3
@CJP3 8 ай бұрын
Thanks for the feedback! I’ll do more of this style!
@mushinart
@mushinart Жыл бұрын
Outstanding explanation, professor
@CJP3
@CJP3 Жыл бұрын
Thank you so much!
@dannybee9068
@dannybee9068 Жыл бұрын
Thank you! That was helpful! So we basically can make the root of any power? Is there a drawbag for exploiting it , like keep increasing the n value for feature to the power of 1/n?
@CJP3
@CJP3 Жыл бұрын
Hi Danny! Context definitely matters. For analytical chemistry 1/n scaling is usually ok. a few downsides are that it makes the models less sensitive to potential outliers. Also its not suitable for certain distributions. Lastly, because 1/n scaling is non-linear, it can make data interpretation more difficult.
@Lendemeier
@Lendemeier 10 ай бұрын
Bro this is data science ASMR 🤤
@CJP3
@CJP3 10 ай бұрын
Hahaha I didn’t mean for it to be but glad you enjoyed it (I hope) 😂
@pabloagogo1
@pabloagogo1 7 ай бұрын
This is interesting. If one corrects the original skewed data, via doing these kinds of transformations, in the context of linear regression or multiple linear regression, will that not change the interpretation of the original data. Curious to know.
@CJP3
@CJP3 7 ай бұрын
Perhaps, but that change may be for the better. I’d say it’s worth considering these transformation if you know you have skewed data. Many models especially linear models assume normally distributed variables. I usually build models with and without significant preprocessing and feature scaling/engineering.
@nicolaslpf
@nicolaslpf Жыл бұрын
Amazing video! I was creating a function for measuring the same you forgot to name log1p Wich is log of (x+1) really useful for right skewed data with values less than 1
@AyahuascaDataScientist
@AyahuascaDataScientist 8 ай бұрын
Skewing doesn’t necessarily matter if you’re using XGBoost, correct? For classification or regression, that is
@CJP3
@CJP3 8 ай бұрын
Exactly! Skewed data doesn’t impact all model frameworks.
@thoniasenna2330
@thoniasenna2330 10 ай бұрын
SUBSCRIBED! What should one do before? Or, what's the correct order? - treating outliers, impute missing values, correct symmetry? Thanks Dr. P!
@CJP3
@CJP3 10 ай бұрын
You’re not going to like the answer 😂… it depends a lot on the application. It’s first best to be aware they exist and then evaluate their impact on your outcome. For example if you’re trying to determine outlier samples - then outlier msmts wouldn’t be so bad.. maybe. Or missing values could be useful depending on the application so instead of imputing maybe you engineer a new feature.
@CJP3
@CJP3 10 ай бұрын
Don’t unsubscribe after my answer! 😂 🤣
@Stardust_Byproduct
@Stardust_Byproduct 6 ай бұрын
So what about if we were to standardize using z-scoring? It seems like that would get largely the same impact, wouldn't it?
@CJP3
@CJP3 5 ай бұрын
Howdy, Z-scaling won’t improve the skew. The data will be mean-centered but will carry the non-uniform distribution
@Stardust_Byproduct
@Stardust_Byproduct 4 ай бұрын
@@CJP3 that explains it. Thanks!
@CJP3
@CJP3 4 ай бұрын
@@Stardust_Byproduct I think I’ll make a video that graphically illustrates this point. Thanks for asking :)
@Stardust_Byproduct
@Stardust_Byproduct 4 ай бұрын
@@CJP3 yes that would be amazing! Thank you!
@noobmasteroo69
@noobmasteroo69 4 ай бұрын
You're doing great, please avoid bg music while explaining. Thank you.
@CJP3
@CJP3 4 ай бұрын
Thanks for the feedback! Glad you enjoyed the video
@pewkaboo
@pewkaboo Жыл бұрын
What if my data contains a lot of useful '0' values?
@CJP3
@CJP3 Жыл бұрын
Howdy! Can you explain more about the 0’s?
@pewkaboo
@pewkaboo Жыл бұрын
@@CJP3 it is a expenditure data where the budget column contains a lot of '0' (not null) values.
@prathambhatnagar8653
@prathambhatnagar8653 10 ай бұрын
please dont add background music
@CJP3
@CJP3 10 ай бұрын
Thanks for the feedback. Most of the newer coding tutorials don’t have background music. Have a great day!
@AyahuascaDataScientist
@AyahuascaDataScientist 8 ай бұрын
I like it. Don’t listen to this hater!
@mouhsineelqesry9446
@mouhsineelqesry9446 8 ай бұрын
Bro you explain a concept, but go you need the music!! It’s distracting
@CJP3
@CJP3 8 ай бұрын
I 💯 understand, they newer videos don’t have the music and the audio has a better EQ :)
Handling skewness
11:33
Sukamal Das
Рет қаралды 31 М.
Normalization Vs. Standardization (Feature Scaling in Machine Learning)
19:48
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
NumPy vs SciPy
7:56
IBM Technology
Рет қаралды 48 М.
Learn How to Boost Your Python Sklearn Models with GridsearchCV!
11:21
Symmetric, right skewed (positively), and left skewed (negatively) distributions
5:06
Dane McGuckian (STATSprofessor)
Рет қаралды 61 М.
Fitting Probability Distributions to Data with SciPy (Python)
16:23
Mike Saint-Antoine
Рет қаралды 16 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 281 М.
Statistics 101: Variable Transformations, LOG Transform in Excel
18:32
Exploratory Data Analysis with Pandas Python
40:22
Rob Mulla
Рет қаралды 526 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН