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
  • Наука та технологія

КОМЕНТАРІ • 66

  • @starshipx1282
    @starshipx1282 2 роки тому +4

    You’re the best instructor not just for seaborn but for any python library.

  • @brianoliver7240
    @brianoliver7240 3 роки тому +12

    Great video! Thank you. I appreciate how clear and concise you content is.

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      Excellent -- glad you are enjoying my content!

  • @yarethreyes8737
    @yarethreyes8737 Рік тому

    Im starting in the data interpretation world and this video helps me a lot, thank you

  • @simplemente_humano
    @simplemente_humano 3 роки тому +1

    Effective, efficient, helpful and creative! Thanks for your tutorials!

  • @lucky_EINS
    @lucky_EINS 3 роки тому

    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 :)

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому +1

      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!

  • @djardar
    @djardar Рік тому

    This content is amazing! I learn both useful python code AND great visualizations. 👍😄

  • @morasekhi
    @morasekhi 3 роки тому +2

    Thank you very much for your detailed videos, looking forward to seeing more videos.

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому +1

      So glad you are enjoying them -- And definitely more to come!

  • @elsabecker371
    @elsabecker371 2 роки тому

    I am so glad I found you. I think I will use you a lot. I am new to data analytics

  • @gokulraj8302
    @gokulraj8302 2 роки тому

    Way of teaching is very nice😍

  • @oayala65
    @oayala65 2 роки тому

    I learn a lot. Thanks Kimberly...!!!!

  • @drytadpole
    @drytadpole 2 роки тому

    Really well made video!! Thank You ma'am

  • @mahamanoumar1802
    @mahamanoumar1802 3 роки тому

    I really appreciate the way you are explaining..keep doing it

  • @lemonbitter7641
    @lemonbitter7641 2 роки тому +1

    thanks @Kimberly for this nice explanation.

    • @KimberlyFessel
      @KimberlyFessel  2 роки тому +1

      Most welcome! Happy to hear you enjoyed my explanation 😄

  • @igoweiqibaduk8283
    @igoweiqibaduk8283 2 роки тому

    Thank you for video!

  • @sriratna9211
    @sriratna9211 3 роки тому

    Thank you ! Helped me a lot, you are awesome !

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      So glad to hear this video helped you! You are too kind 😄

  • @rishabhahuja171
    @rishabhahuja171 3 роки тому

    Bring more videos ! Machine learning plz... This content is awesome

  • @humbertoluzoliveira
    @humbertoluzoliveira Рік тому

    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.

  • @hormazddoc4244
    @hormazddoc4244 10 місяців тому

    Please make a video for data analysis of the pairplot.

  • @aprashnani
    @aprashnani 3 роки тому

    Nicely Explained! Thanks..

  • @ahmedmostafaelgamal2795
    @ahmedmostafaelgamal2795 2 роки тому

    great work , Thanks a million

  • @hamza3065
    @hamza3065 3 роки тому

    Thanks alot Kimberly

  • @GaganDeep-ul7jy
    @GaganDeep-ul7jy 3 роки тому

    with each video I watch. I am falling in love with you❤❤❤❤

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      Glad to hear you are enjoying the videos - cheers!

  • @himaharidev
    @himaharidev 2 роки тому

    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!

    • @KimberlyFessel
      @KimberlyFessel  2 роки тому

      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.

  • @fernandohenriquesantorsula8084

    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.

  • @sumitsehrawat3718
    @sumitsehrawat3718 3 роки тому +1

    How to interpret hist plot in the example shown
    What exactly it is representing

  • @vishalsinha9020
    @vishalsinha9020 2 роки тому

    Great Content..!!!!

  • @vedanthbaliga7686
    @vedanthbaliga7686 3 роки тому

    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

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      So glad these videos have been helpful! And yes, I am definitely working on the SEO -- hopefully will start ranking higher soon. 😄

  • @faridbabayev1657
    @faridbabayev1657 3 роки тому

    Hi! Thank you for video! Could you please tell me how to change the color of line in 'reg' kind?

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      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'}})"

  • @060584saurav
    @060584saurav 3 роки тому

    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

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      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.

  • @R7m7m
    @R7m7m 2 роки тому

    you helped me

  • @taowang2731
    @taowang2731 2 роки тому

    wow, that is the real thing

  • @friendsforever715
    @friendsforever715 3 місяці тому

    what should be put to exclude a column from the dataframe in the pairplot graph? thanks

    • @KimberlyFessel
      @KimberlyFessel  3 місяці тому

      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.

  • @anithan1
    @anithan1 3 роки тому

    Hey nice video, how to get that interactive button to increase / decrease teh height

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      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

  • @mohammed_Ansar
    @mohammed_Ansar 3 роки тому

    hey there, how can i learn about inbuilt keyword arguments and functions. where can i check it?

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      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

  • @web64dev
    @web64dev Рік тому

    I didn't understand the graphs along the diagonal and what they represent.

  • @sankarbareddy3515
    @sankarbareddy3515 2 роки тому

    hi, Kim. great video. By the way you look alike Kim Wexler from Better call Saul.

  • @raymondmccleery3513
    @raymondmccleery3513 3 роки тому

    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.

    • @raymondmccleery3513
      @raymondmccleery3513 3 роки тому

      Figured it out, never mind!

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому +1

      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. 👍

    • @raymondmccleery3513
      @raymondmccleery3513 3 роки тому

      @@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?

  • @mitchrawlyk5705
    @mitchrawlyk5705 3 роки тому

    Is it possible to hire you to tutor me?

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      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.

  • @r-rk
    @r-rk 3 роки тому

    where is interpretation?

    • @KimberlyFessel
      @KimberlyFessel  3 роки тому

      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!

    • @r-rk
      @r-rk 3 роки тому

      @@KimberlyFessel yeah, that's what I want how to interpret the results from the plot.
      Looking forward for the video
      Thank you.