# How choose smoothing function for Generative Additive Models? (GAMs)

I would like to know which strategies are used in practice to choose the correct smoothing function for each features in the GAMs, both for classification and regression tasks. I thought of plotting a 2D graph and checking the trend of the distribution of the values ​​of a features with respect to the classes / numerical outputs (for regression) and on the basis of this choose whether to use an appropriate smoothing function or linear function.

• The "G" stands for "Generalized" (with the same meaning as in GLM). Anyway, I'd recommend using mgcv:gam, which uses penalized regression splines (and can therefore reduce the smoothers' "wiggliness" to a linear relationship or even remove them). – Roland Aug 28 '20 at 6:10
• Sisi excuse me, typing error. Thank you very much for your reply. So what you told me would be equivalent if using a P-Splines. However, I wanted a display method that would allow me to check in advance whether a Features has a linear distribution or not with respect to the class. That's why I thought I was viewing a 2D chart with all the values ​​of a Feature – Francesco Ladogana Aug 28 '20 at 7:12
• That works as long as you have exactly one feature. – Roland Aug 28 '20 at 9:28
• No obviously this has to be repeated for each input features. I do this reasoning because a Smoothing function is applied for each Fetures in the GAMs. Therefore the final model will be given by the additivity of these smoothing functions – Francesco Ladogana Aug 28 '20 at 9:33
• Yes, but you can't inspect these smoothing functions without fitting the model and changing one of them also impacts the other ones. – Roland Aug 28 '20 at 10:10