Seaborn pairplot | How to make a pairplot in Python and the Seaborn pairplot interpretation
Вставка
- Опубліковано 28 чер 2024
- This Seaborn paiplot video covers how to make a pairplot with Seaborn Python as well as the Seaborn pairplot interpretation. I begin with the basics of the Seaborn pairplot including how to code an example pairplot. I then discuss the kind of figures that can be used on a pairplot by changing the diag_kind or kind arguments: scatterplot, regplot, histogram, or kdeplot. Next I demonstrate how to pass categorical variables to the hue property and how to make a Seaborn pairplot with only one row. Lastly, I show pairplot examples using advanced styling techniques like changing the palette or size and aspect ratio of the Seaborn pairplot.
0:00 Introduction
0:51 Pairplot Basics
3:21 Plot Kinds
4:52 Categorical & Select Variables
7:59 Advanced Styling
12:17 Conclusion
Github Code:
github.com/kimfetti/Videos/bl...
Related Videos:
Seaborn scatterplot - • Seaborn scatter plot |...
Seaborn regplot - • Seaborn regplot | What...
Seaborn distplot - • Seaborn distplot | Sea...
Seaborn KDEplot - • What is kernel density...
Intro to Seaborn - • Introduction to Seabor...
#seaborn #dataviz - Наука та технологія
You’re the best instructor not just for seaborn but for any python library.
Great video! Thank you. I appreciate how clear and concise you content is.
Excellent -- glad you are enjoying my content!
Im starting in the data interpretation world and this video helps me a lot, thank you
Effective, efficient, helpful and creative! Thanks for your tutorials!
So glad you like them -- cheers!
just binge watched your hole series. I'm learning matplotlib, but now it looks like that seaborn has a lot to offer. Thanks for this great series :)
What a compliment -- thank you! Glad to hear you enjoyed my series. Seaborn definitely has a lot to offer, and the great thing is that you can use most matplotlib commands to customize seaborn plots, too!
This content is amazing! I learn both useful python code AND great visualizations. 👍😄
Thank you very much for your detailed videos, looking forward to seeing more videos.
So glad you are enjoying them -- And definitely more to come!
I am so glad I found you. I think I will use you a lot. I am new to data analytics
Way of teaching is very nice😍
I learn a lot. Thanks Kimberly...!!!!
Really well made video!! Thank You ma'am
I really appreciate the way you are explaining..keep doing it
Super -- will do!
thanks @Kimberly for this nice explanation.
Most welcome! Happy to hear you enjoyed my explanation 😄
Thank you for video!
Thank you ! Helped me a lot, you are awesome !
So glad to hear this video helped you! You are too kind 😄
Bring more videos ! Machine learning plz... This content is awesome
Thanks so much for the support! 😄
Hi kimberly, great video! Amazing! Would you like to get the slope and linear coefficients from the kind='reg' option in sns.pairplot? Congratulations on the excellent content.
Please make a video for data analysis of the pairplot.
Nicely Explained! Thanks..
Most welcome!
great work , Thanks a million
Thanks and you are most welcome!
Thanks alot Kimberly
You're very welcome! 👍
with each video I watch. I am falling in love with you❤❤❤❤
Glad to hear you are enjoying the videos - cheers!
Hi Kimberley, thank you for your great videos. Learnt a lot. May I know if there is a way to remove outlier points which affect the regression line in pairplots or pair grids? Thanks in advance!
Yes! You can do this by updating the arguments to plot a "robust regression" for the off-diagonal regplots. Robust regression down-weights the outliers when fitting the regression line. Something like this:
sns.pairplot(df, kind='reg', plot_kws={'robust': True, 'n_boot': 100});
I have also decreased the number of bootstraps here because robust regression is significantly more computationally expensive. You can alternatively add 'ci':None if you don't need confidence intervals for the regression lines.
Sensational, congratulations for the video, it was sensational...! A question please! I wanted to use this library to capture statistics from a Wi-Fi card of a Raspberry version 4, model B, and generate graphics, simulating the "In-band Network Telemetry" protocol, is it possible? Thanks.
How to interpret hist plot in the example shown
What exactly it is representing
Great Content..!!!!
Thanks very much - glad you enjoyed it!
Thank you for making these videos! They are helping me a lot. Maybe you should try SEO Optimization to rank your videos on top of the youtube recommendations
So glad these videos have been helpful! And yes, I am definitely working on the SEO -- hopefully will start ranking higher soon. 😄
Hi! Thank you for video! Could you please tell me how to change the color of line in 'reg' kind?
Oh sure! Within the pairplot function you can access the plot_kws and then the line_kws if you just want to update the line color. For example, "sns.pairplot(tips, kind='reg', plot_kws={'line_kws': {'color':'black'}})"
Hi Kimberly: Thanks for such clear explanation. I want to know if we can change the size of axis title and axis value. My Data set has seven parameters so each plot become very small and corresponding axis title and axis value also become very small
Hi there - sure, there are a couple of different things you can try here. First, you could increase the height of your figure if you have a lot of plots; for example, sns.pairplot(df, height=3). The default height is 2.5, so anything larger than that would increase the plot area... but it won't change the font sizes of the titles or axes. To do that, you could add sns.set(font_scale=2) above your figure. That will double the size of all fonts since the default font_scale is 1. This would actually change the rcParams in the backend so all figures you create after this will also have larger fonts.
you helped me
So great to hear that!
wow, that is the real thing
what should be put to exclude a column from the dataframe in the pairplot graph? thanks
You can pass a list of column names that you WOULD like to plot to the vars keyword. Or if you just want to exclude one column, you could do something like sns.pairplot(df.drop(columns='col_name')) where df is the name of your dataframe variable and 'col_name' is your column's name as a string.
Hey nice video, how to get that interactive button to increase / decrease teh height
Hi there -- that's a Jupyter Widget from the ipywidgets library (ipywidgets.readthedocs.io/en/stable/). I have been considering making a video about them, so hopefully that will be coming up eventually. But for now, you can find the code I used to make that specific widget under the "Styling" header on my GitHub page: github.com/kimfetti/Videos/blob/master/Seaborn/12_pairplot.ipynb
hey there, how can i learn about inbuilt keyword arguments and functions. where can i check it?
Hi - I usually start by looking at the seaborn documentation for the specific plot I want to make. For example, here is the documentation for the pairplot: seaborn.pydata.org/generated/seaborn.pairplot.html I also like to look through the full seaborn API reference to learn what different functions are available: seaborn.pydata.org/api.html Finally, whenever something isn't fully clear from the documentation, I read the source code. The entire seaborn library is available on GitHub here with most of the code in the "seaborn" folder: github.com/mwaskom/seaborn
I didn't understand the graphs along the diagonal and what they represent.
hi, Kim. great video. By the way you look alike Kim Wexler from Better call Saul.
Hi Kimberly. Thank you for this video! Can you show some code for how to load my own data for this kind of plot, from a *.txt or *.csv file, from my computer? The data set is a table of data 26 columns by 49 points with column headers. Thanks.
Figured it out, never mind!
Glad to hear you figured it out! In case others are also curious, I would likely load the data using pandas. If pandas has been imported using "import pandas as pd", you can load in a csv using df = pd.read_csv(filename) where filename is either a file on your computer in the same directory as your code or is a path to the file. Then df will be a pandas dataframe that you can plot with seaborn.
One note of caution: if you have 26 numeric columns, you will likely not want to display all of the data on a pairplot because the individual subplots will be very small. You can pass a list to the pairplot's vars argument to select only certain columns to be plotted. 👍
@@KimberlyFessel , yes it's a bit out of control! LOL.
But, being able to see them all is, for me, an important aspect of data mining when you are looking for hidden relationships. Would using the slider widget help in this case, or would it not really help because you are limited by the width of the display area in Jupyter Notebook? Is there away to directly send the plot to a larger frame document, like a PDF?
Is it possible to hire you to tutor me?
I'm flattered! But I am currently working as a full-time instructor at Metis data science bootcamp. Not taking on private tutoring at this time.
where is interpretation?
Hi - this video interprets what each component of the pairplot means and where the data come from. Where you interested in the interpretation we can draw from the pairplot about the underlying dataset? I have been considering making a few videos like that as well!
@@KimberlyFessel yeah, that's what I want how to interpret the results from the plot.
Looking forward for the video
Thank you.