Linear regression

Linear regression is an approach in modeling that helps model the scalar linear relationship between a scalar dependent variable, Y, and an independent variable, X, which can be one or more in value:

Linear regression

Let's try to understand this using an example. The following table shows the list of height and weight of students in a class:

Height (inches)

Weight (pounds)

50

125

58

135

63

145

68

144

70

170

79

165

84

171

75

166

65

160

If we run this through a simple linear regression function, which will be covered in a later chapter, with the weight as a dependent variable, y, and the independent variable, x, which is the height, ...

Get Mastering Python for Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.