A Free, Interactive Course using mgcv

Hello! Welcome to Generalized Additive Models in R. This short course will teach you how to use these flexible, powerful tools to model data and solve data science problems. GAMs offer offer a middle ground between simple linear models and complex machine-learning techniques, allowing you to model and understand complex systems.

To take this course, you need basic R programming skills and experience with linear regression. Now let's get started!

1 - Introduction to Generalized Additive Models

In 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.

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.

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.

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.

Reference and Resources

Here are scripts to re-use and links to additional references and topics to learn.