Hi,
I am currently reading Feature Engineering and Selection by Max Kuhn and Kjell Johnson. In Chapter 9 [p 206] It is mentioned that a feature could be added to show a specific trend in a group. For example, if I was trying to classify an item and I had 300 days of very noisy longitudinal data, I could run a linear regression and use the slope (feature 1) of this regression as a proxy with the the trimmed median (feature 2) and MAD (feature 3) values to summarize the history of this group of items per day (if the pattern if this feature is going up or down). My question is two fold

How would I achieve the linear regression portion within the tidy models framework (it would need to be done I imagine within the resamples)

Is it possible to use a different model than Linear regression to summarise the trend, for example MARs which may capture a non linear pattern than that of the linear regression. How would i summarise the formula within a column to become a feature to be picked up by my main model? Is this also possible in
tidymodels
?
Thank you very much for your time