O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Partial regression plots

Partial regression plots are useful in regression to observe the effect of the individual variables independently of the other variables. Use the termplot() function to view the variables in the model separately. The termplot curves roughly correspond to the slopes of the regression line, so you can visually observe the effect of each variable as the levels or continuous values change.

For the regression that we just ran, males, satisfaction levels 3 and 4, and monthly charges are all marked as significant in the regression output, so we can observe their individual slopes by looking at the plots.

The following code will loop through all the variables in the model and produce the following plots. The sixth term (monthly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required