ot;,&quot;Locked_Models&quot;,&quot;RNA_TE_ssl.rds&quot;))


get_coefs &lt;- function(model) {
  orig_coefs &lt;- coef(model$finalModel, s = model$bestTune$lambda) * (-1)
  pr &lt;- prep(model$recipe)
  model_input &lt;- suppressWarnings(bake(pr, new_data = model$trainingData))

  feature_means &lt;- model_input  %&gt;%
      select(-c(id, type)) %&gt;%
      colMeans()
  feature_sds &lt;- model_input %&gt;%
      select(-c(id, type)) %&gt;%
      as.data.frame() %&gt;%
      summarise_all(sd)
  feature_coe