Seaborn lineplot | How to make a Seaborn lineplot and what is bootstrapping in Seaborn?

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • This Seaborn lineplot video shows you how to make a Seaborn lineplot and what bootstrapping is in Seaborn. Bootstrapping is used in Seaborn to make confidence intervals about your line plot. I also explain how to use hue (color), style, and size to show more information through your lineplot in Python Seaborn. And I end by discussing how to style your Seaborn lineplot with matplotlib Python code.
    0:00 What is a lineplot?
    0:53 CODE - How to make a lineplot in Seaborn
    4:37 How to build confidence intervals with bootstrapping?
    7:55 CODE - Using code to change bootstrapping and confidence intervals
    9:47 Showing information through line color, style, and size
    10:08 CODE - Line color, style, size in Seaborn
    12:30 CODE - Styling your lineplot with matplotlib
    12:58 Conclusion
    Github code:
    github.com/kimfetti/Videos/bl...
    #seaborn #dataviz
  • Věda a technologie

Komentáře • 56

  • @denisbaranoff
    @denisbaranoff Před 2 lety

    I didn't even guess about these options (confidence interval with bootstrapping) in sns as embedded option. Thank you!

  • @FarizDarari
    @FarizDarari Před 3 lety

    Thanks for the nice & clear illustrative explanation of bootstrapping for getting confidence intervals! Subscribed!

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      So glad it was helpful! Bootstrapping is such a useful technique, but it definitely takes some explaining 😄 Thanks for subscribing!

  • @ryanbackherms1086
    @ryanbackherms1086 Před 2 lety

    Loved this video! It was easy to follow and was very concise.

  • @Funzelwicht
    @Funzelwicht Před rokem

    Cool explanation for boostrapping, thanks! :)

  • @sahilpokharkar7053
    @sahilpokharkar7053 Před 2 lety

    It’s really helpful video for me….Thanks🙏
    And compliment for you is you looking cute 😊

  • @adityadubey9565
    @adityadubey9565 Před 3 lety

    This channel deserves a lot more subscribers.

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      Why thank you! Slowly but surely it is growing every day! 😀

  • @robingraham1521
    @robingraham1521 Před 3 lety +1

    I am new to Matplotlib, Pandas, Numpy and Seaborn. I have looked at all the videos I could find and finished up more confused. It was not until I watched Kimberely that everything started to make sense. I made more progress in one evening watching her than the previous month daily watching other videos. Kimberely makes things very clear and easy to follow

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      Oh wow - thank you very much for the compliment! That makes me so happy that my videos have been helpful for you. 😄 And thanks for watching!

  • @williambertolasi1055
    @williambertolasi1055 Před 3 lety

    Good explanation: simple, clear and comprehensive.

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +1

      Thanks! Happy to hear you found the video useful!

  • @chaoscifer1483
    @chaoscifer1483 Před rokem

    Love it. Thank you.

  • @Blocktelligence
    @Blocktelligence Před rokem

    You’re really good. Thank you.

  • @lekanadenusi462
    @lekanadenusi462 Před 2 lety

    I love your channel. ☺

  • @lukskywaker
    @lukskywaker Před 3 lety

    Your videos are one of the best in CZcams. Thank you Mam.

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      Oh thank you so much for the compliment! Glad you are enjoying them.

  • @senzhan221
    @senzhan221 Před 2 lety

    good explanation!

  • @lucapassani1129
    @lucapassani1129 Před 3 lety

    You are good. Thank you for your tutorials.

  • @wankenny
    @wankenny Před rokem

    Hi Kimberly, thanks for the video. Do you have an example of seaborn line plot with multiple x-variables on the same axis?

  • @shashankpandey1966
    @shashankpandey1966 Před 3 lety

    Big fan of your teaching 🔥

  • @nanaamapinto2352
    @nanaamapinto2352 Před 2 lety +1

    Thanks for the tutorial very understandable from previous lessoons to this. However have a problem with the renaming of the columns . i keep getting this feedback error as follows "Attribute Error: 'Data Frame' object has no attribute 'Timestamp' "
    I enter rightly as you have in the tutorial but still get the same feedback. Any help on this please. Thank you

  • @sbedekar93
    @sbedekar93 Před 3 lety

    best seaborn tutorial on youtube :)

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      Wow -- thanks for the compliment! 😀 Glad to hear you are enjoying my tutorial.

  • @brandonjones5326
    @brandonjones5326 Před 3 lety

    Thanks so much for this!

  • @youcefyahiaoui1465
    @youcefyahiaoui1465 Před rokem

    Hi Kimberly, Hope you're well. Can you please have a video on how to plot a matrix over a vector of x values (multiple plots at once). I have data representing n points on a line but they're all givinen in 6 column data frame as a shape x1, x2, x3, y1, y2, y3 as one row then multipl rows repeat of similar data. How can you reshape then plot (x1,y1), (x2, y2) & (x3,y3) as one line of one row... Your answer is much appreciated. Thank you

  • @daschneider9
    @daschneider9 Před 2 lety

    I would like to know how to add the reference range shading as in this video at the 5 minute mark. Do you have a demo of that?

  • @LifetimeStd
    @LifetimeStd Před 3 lety +1

    Hi Kimberly!
    Ken from Brazil here. Thank you very much for your videos! They are helping me a lot as a very nice complement for a course that I'm taking!!
    Your explaining of theory behind technique helps a lot!
    I know the code is in github but for those who are coding along with the video like me, at time 1:55 if you don't use (hidden by text length) "inplace=True" in rename function, you will probably face an AttributeError: 'DataFrame' object has no attribute 'Timestamp' error :)

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +1

      Oh yes - you are correct, Ken! My apologies for not scrolling to the right. The full code has *"inplace=True" for the rename method* in cell #6 at 1:55.
      Thank you for clarifying and glad to hear the videos are helpful!

    • @LifetimeStd
      @LifetimeStd Před 3 lety +1

      @@KimberlyFessel don’t worry. you don’t need to apologize for that at all! Haha all the best kimberly!

  • @GregThatcher
    @GregThatcher Před měsícem

    Thanks!

    • @KimberlyFessel
      @KimberlyFessel  Před měsícem

      Really appreciate the support - thanks so much! 😀

  • @zouhir2010
    @zouhir2010 Před 3 lety +1

    nice necklace
    great explanation

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +1

      Haha - thank you very much! Glad to hear you liked the explanation and my necklace! I try to keep stylish 😄

  • @SatendraYadav-cs1yh
    @SatendraYadav-cs1yh Před 3 lety +1

    Awesome video for all seaborne tutorial. mam please make video for Machine learning also.

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +2

      Hi there -- glad you are enjoying the Seaborn videos! I do plan to branch out a bit from the data viz videos at some point. Maybe mathematical or statistical concepts. Actually was thinking about trying to visualize some error metrics or distance metrics soon. 😄

  • @sakshimishra9198
    @sakshimishra9198 Před 3 lety

    I came back to your channel to understand stuff, an Amazing explanation.
    Also, I wish to ask a small question,
    say we have a data set of 10 students and their different marks, I wish to plot the lineplot for the various subjects and for all the 10 students in the same plot.

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      Very glad to hear you are learning from my channel! Regarding your question, you could theoretically make the plot you mentioned with the code sns.lineplot(data=data, x="subject", y="marks", hue="student") to split the students into their own lines. However, most often we use lineplots to display two continuous variables like time and occupancy shown in this video. Since you have various subjects (categorical) and marks (continuous), I would probably use a barplot or maybe a heatmap or clustermap to show these data instead. 👍

  • @karakol86
    @karakol86 Před 3 lety

    Hi, great video! Question about the syntax, “‘xkcd:brick red’ - are there other color libraries/surveys besides the XKCD color survey, matplotlib and just passing general colors? I have never seen xkcd used before!

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +1

      There are so many ways to specify color in matplotlib! 😄 As you mentioned, there are several named colors but matplotlib/seaborn also accepts RGB tuples, hex codes, the xkcd color library, and the 10 Tableau colors. (matplotlib.org/tutorials/colors/colors.html) I plan to make at least one video about matplotlib colors in the future!

  • @rajatgupta7344
    @rajatgupta7344 Před 3 lety +2

    can you please explain plt.rc('date.autoformatter',day='%b %Y')
    following your series it is superb.

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +1

      Glad to hear that! With that line of code I'm updating one of matplotlib rc parameters, specifically the format of how days will appear in my figures. The string "%b %Y" actually makes all my days appear as a short-named month and a longer year... "Nov 2020" or "Feb 2019" for example. Normally we wouldn't want to do that since it no longer mentions the day, but for these figures I was going for less granular dates.

  • @hansmaier479
    @hansmaier479 Před 3 lety

    Can I depict the standard error of the mean?

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety +1

      Not standard error but you can display +/- one standard deviation by setting ci="sd" 👍

  • @code2compass
    @code2compass Před 3 měsíci

    I am not getting conf intervals in my plots. Is it the new update which is turning them off by default?

    • @KimberlyFessel
      @KimberlyFessel  Před 3 měsíci +1

      Do you have multiple data points for each value along your x-axis? You will only get the confidence intervals if your dataset has multiple values for the x-positions. You can see an example of each default behavior in the seaborn lineplot docs (seaborn.pydata.org/generated/seaborn.lineplot.html). In the first plot, the data is only for May (does not have multiple values for each x), so there are no conf intervals. In the example midway down, there are confidence intervals because the entire dataset is plotted and there are multiple values for each x-position (year). Hope that helps!

    • @code2compass
      @code2compass Před 3 měsíci

      @@KimberlyFessel so it means for each x(i) there has to be an upper and lower value for each given value right?
      What if we calculate that ourselves!

    • @KimberlyFessel
      @KimberlyFessel  Před 3 měsíci +1

      @@code2compass Seaborn does bootstrapping of all the datapoints at each x-position to find those confidence intervals for you. But nothing would stop you from creating your own CIs. You could just add a matplotlib element to fill between two sets of y values (matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_demo.html) and set alpha to make the shading transparent. 👍

    • @code2compass
      @code2compass Před 3 měsíci

      @@KimberlyFessel yeah I just figured it out. Waiting for your playlist on time series analysis

  • @Himanshu-ed3mf
    @Himanshu-ed3mf Před 3 lety

    95% confidence interval means that we are 95% sure that true mean exist in this interval?

    • @KimberlyFessel
      @KimberlyFessel  Před 3 lety

      Pretty much! Here we're using bootstrapping to construct that confidence interval, so it represents bounds such that 95% of the means found (across all the bootstrapped data sets) are contained by these bounds.

  • @MichaelMohr-rz3wf
    @MichaelMohr-rz3wf Před měsícem

    June 4, 2024:
    Oddball transcript is showing instead of video dialogue.

    • @KimberlyFessel
      @KimberlyFessel  Před měsícem

      Wow - it sure is. I attempted to update it, but that doesn't appear to be working. Hopefully will get fixed soon!