I have seen the method of calculating marginal effect for glm, gam and polr packages, but how to calculate marginal effect for lasso regression, such as glmnet packages? Is it extracting the coefficients of lasso regression and then calculating the average dy/dx? I would greatly appreciate it if you could explain it clearly.
This problem has puzzled me for a long time, solving it can fill some gaps.