Transformation of predictors for generalized additive model I have a gam model with automatic predictor selection based on cubic splines (bs = cr) and SELECT == T or shrinkage cubic splines (bs = cs) and SELECT == F.
As I know these predictors should be scaled, because of different data ranges and units and transformed to gaussian distribution.
I got two questions with respect to this topic:

*

*Should I first scale and then transform my predictor data?

*I'm scaling and transforming my predictor data to build the model. Do I also have to scale and transform the predictor data when I make a prediction? - So transforming and scaling the predictor data of new unknown data?

I'm using the following model:
basis <- "ts"
selection <- TRUE
gammaVal <- 1.8
model <- mgcv::bam(formula = TT2 ~
            s(DGM5, k = k, bs = basis) +
            ...
            s(NDVI_MEAN, k = k, bs = basis),
            data = trainSet, family = gaussian(), method = "fREML", select = selection,
            gamma = gammaVal, scale = 1, control = ctrl, cluster = cl, discrete = TRUE, nthreads = 31)

I try to predict some kind of air temperature based on Height Model, Vegetation Index, Buildings, Sealing etc.

Scaling is a linear transformation and therefore the order doesn't matter. You can scale first and then transform or the other way around.
When predicting you must use the exact same scaling and transformation you used when fitting the model for the prediction to be valid. Note that you still use the preprocessing used on your training data, i.e. the data used to fit the model, when predicting.
