Nonlinear Modeling with Generalized Additive Models (GAMs) in R
GAMs model relationships in data as nonlinear functions that are highly adaptable to different types of data science problems.
Start Course for Free4 hours15 videos50 exercises8,199 learnersStatement of Accomplishment
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Training 2 or more people?
Try DataCamp for BusinessLoved by learners at thousands of companies
Course Description
Generalized Additive Models are a powerful tool for both prediction and inference. More flexible than linear models, and more understandable than black-box methods, GAMs model relationships in data as nonlinear functions that are highly adaptable to different types of data and data science problems. In this course, you'll learn how GAMs work and how to construct them with the popular mgcv package. You'll learn how to interpret, explain and visualize your model results, and how to diagnose and fix model problems. You'll work with data sets that will show you how to apply GAMs to a variety of situations: automobile performance data for building mixed linear and nonlinear models, soil pollution data for building geospatial models, and consumer purchasing data for classification and prediction. By the end of this course, you'll have a toolbox for solving many data science problems.
Training 2 or more people?
Get your team access to the full DataCamp platform, including all the features.- 1
Introduction to Generalized Additive Models
FreeIn this chapter, you will learn how Generalized additive models work and how to use flexible, nonlinear functions to model data without over-fitting. You will learn to use the gam() function in the mgcv package, and how to build multivariate models that mix nonlinear, linear, and categorical effects to data.
Introduction50 xpMotorcycle crash data: linear approach100 xpMotorcycle crash data: non-linear approach100 xpParts of non-linear function100 xpBasis functions and smoothing50 xpSetting complexity of the motorcycle model100 xpUsing smoothing parameters to avoid overfitting100 xpComplexity and smoothing together100 xpMultivariate GAMs50 xpMultivariate GAMs of auto performance100 xpAdding categorical to the auto performance model100 xpCategory-level smooths for different auto types100 xp - 2
Interpreting and Visualizing GAMs
In this chapter, you will take a closer look at the models you fit in chapter 1 and learn how to interpret and explain them. You will learn how to make plots that show how different variables affect model outcomes. Then you will diagnose problems in models arising from under-fitting the data or hidden relationships between variables, and how to iteratively fix those problems and get better results.
Interpreting GAM outputs50 xpSignificance and linearity (I)100 xpSignificance and linearity (II)50 xpVisualizing GAMs50 xpPlotting the motorcycle crash model and data100 xpPlotting multiple auto performance variables100 xpVisualizing auto performance uncertainty100 xpModel checking with gam.check()50 xpReading model diagnostics100 xpFixing problems with model diagnostics100 xpChecking concurvity50 xpExamining overall concurvity in auto data100 xpExamining concurvity between auto variables100 xp - 3
Spatial GAMs and Interactions
In this chapter, you will extend the types of models you can fit to those with interactions of multiple variables. You will fit models of geospatial data by using these interactions to model complex surfaces, and visualize those surfaces in 3D. Then you will learn about interactions between smooth and categorical variables, and how to model interactions between very different variables like space and time.
Two-dimensional smooths and spatial data50 xpModeling soil pollution in the Netherlands100 xpAdding more variables to predict soil pollution100 xpPlotting and interpreting GAM interactions50 xpPlotting the model surface100 xpCustomizing 3D plots100 xpExtrapolation in surface plots100 xpVisualizing categorical-continuous interactions50 xpSoil pollution in different land uses100 xpPlotting pollution in different land uses100 xpInteractions with different scales: Tensors50 xpPollution models with multi-scale interactions100 xpTeasing apart multi-scale interactions100 xp - 4
Logistic GAMs for Classification
In the first three chapters, you used GAMs for regression of continuous outcomes. In this chapter, you will use GAMs for classification. You will build logistic GAMs to predict binary outcomes like customer purchasing behavior, learn to visualize this new type of model, make predictions, and learn how to explain the variables that influence each prediction.
Types of model outcomes50 xpClassifying purchasing behavior100 xpPurchase behavior with multiple smooths100 xpVisualizing logistic GAMs50 xpVisualizing influences on purchase probability100 xpInterpreting purchase effect plots (I)50 xpInterpreting purchase effect plots (II)50 xpInterpreting purchase effect plots (III)50 xpMaking predictions50 xpPredicting purchase behavior and uncertainty100 xpExplaining individual behaviors100 xpDoing more with GAMs50 xp
Training 2 or more people?
Get your team access to the full DataCamp platform, including all the features.DataCamp Content Creator
See MoreCourse Instructor
DataCamp offers interactive R, Python, Spreadsheets, SQL and shell courses. All on topics in data science, statistics, and machine learning. Learn from a team of expert teachers in the comfort of your browser with video lessons and fun coding challenges and projects.
What do other learners have to say?
Join over 15 million learners and start Nonlinear Modeling with Generalized Additive Models (GAMs) in R today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.