Yes, all splines are stateful transformations, and we store the design_info in the model.data instance so we can reuse it in predict.
If users use the formula interface to the model, then patsy handles stateful transforms, and statsmodels just delegates in predict.
One consequence is that we only have the information to "interpret" the design matrix, or endog transformation in this case, that patsy provides to us in the `design_info`.
This is now pretty good for categorical factors, and we reuse it also in some Wald tests. There is some information about the splines in design_info but it is not used in the GAM PR.
But there is no way for statsmodels to know that the endog transformation is log, and that we could use our log-link support for it.
A related problem is that the code in patsy is focused on constructing the design matrix, which is not enough for us for supporting extras. If we need to provide statistical support for example for a log transformed variable, then we would need additional methods similar to the ones that are available in our link classes, specifically inverse transforms and derivatives.
Another example, GAM includes wrappers of or copies code from patsy's splines because we need to add derivatives and similar methods to support penalization.
In R, formulas have a much longer history and much more tightly integrated with the models, while our direct interface to models is DataFrames or just numpy arrays, or anything `array_like`. In the array case we just get numbers and have no information at all about whether there is a structure behind that data.
and one more example:
It would be very helpful to provide some automatic support for polynomials that are in the design matrix, i.e. multiple columns that are a transformation of some underlying explanatory variables. Right now there is no way for the models to get that information in a general way. And it will take work for designing and implementing it before we can add those features.
(GAM requires that penalized splines are provided as separate argument and not as part of the design matrix, so we know exactly which splines to support.)