Regression Plots
Let’s learn about plotting regression plots using seaborn.
We'll cover the following...
Seaborn has many built-in capabilities for regression plots. The regression plots in seaborn are primarily intended to add a visual guide that helps to emphasize patterns in a dataset during exploratory data analyses. Let’s learn about the lmplot()
method in this lesson.
First things first, we need to import seaborn
and matplotlib
.
import seaborn as snsimport matplotlib.pyplot as plttips = sns.load_dataset('tips')print(tips.head())
The lmplot()
method
The lmplot()
method allows us to display linear models with seaborn. The method plots data, as well as a regression model across a FacetGrid
. This function actually combines regplot()
and FacetGrid
.
Understanding the difference between regplot()
and lmplot()
can be a bit tricky. In fact, they are closely related, since lmplot() uses regplot()
internally and takes ...