In this #TidyTuesday video, I go over interaction effects using linear models. I use Max Khun's book on Feature Engineering to explain the framework for approaching how to model interactions and when there are too many features where I briefly describe Hierarchy and Heredity principles. I then go on to use base R linear models to select relevant features and show tidy select tricks to select and rename columns quickly. I then use the #TidyModels package to create the pairwise interactions and tune the Main Effects (first stage) lasso regression model and an Interaction Effects (Second Stage) lasso regression model. Finally, I examine how workflows can help reduce clutter in the environment and how to extract coefficients from a trained model.
Connect with me on LinkedIn: Code for this video: Max Khun's Book:
0 Comments