Book Image

Mastering Python for Data Science

By : Samir Madhavan
Book Image

Mastering Python for Data Science

By: Samir Madhavan

Overview of this book

Table of Contents (19 chapters)
Mastering Python for Data Science
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
7
Estimating the Likelihood of Events
Index

Multiple regression


Multiple linear regression occurs when more than one independent variable is used to predict a dependent variable:

Where, Y is the dependent variable, a is the intercept, b1 and b2 are the coefficients, and x1 and x2 are the independent variables

Also, note that squaring the dependent variable still makes it linear, but if the coefficient is squared, then it is nonlinear.

To build the multiple linear regression model, we'll utilize the NBA's basketball data to predict the average points scored per game

The following are the column descriptions of the data:

  • height: This refers to the height in feet

  • weight: This refers to the weight in pounds

  • success_field_goals: This refers to the percentage of successful field goals (out of 100 that were attempted)

  • success_free_throws: This refers tot the percentage of successful free throws (out of 100 that were attempted)

  • avg_points_scored: This refers to the average points scored per game

The following code ingests this data and then we...