Python Data Science Tutorial on Python Linear Regression

in linear regression these two variables are related through an equation, where exponent (power) of both these variables is 1. mathematically a linear relationship represents a straight line when plotted as a graph. a non-linear relationship where the exponent of any variable is not equal to 1 creates a curve.

the functions in seaborn to find the linear regression relationship is regplot. the below example shows its use.

import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('tips')
sb.regplot(x = "total_bill", y = "tip", data = df)
plt.show()

its output is as follows −

lregression.png
Completed Course