Skip to main content
deleted 2 characters in body
Source Link
Deb
  • 319
  • 1
  • 5

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:5]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:5]))

var_imp <- function(object, ...) {
  var_imp_r <- object$variable.importance
  var_imp_r
}

coefs_rf<-as.data.frame(lapply(rf_ranger,function(x)var_imp(x)[1:4]))

However, I'm still looking for a suitable solution2:5 for extractinglm and glm is the variable importance tablenumber of samples rf_rangerEE.. random forest models, where 1 is intercept.

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:5]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:5]))

However, I'm still looking for a suitable solution for extracting the variable importance table of rf_ranger random forest models.

Well, I found a solution,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:5]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:5]))

var_imp <- function(object, ...) {
  var_imp_r <- object$variable.importance
  var_imp_r
}

coefs_rf<-as.data.frame(lapply(rf_ranger,function(x)var_imp(x)[1:4]))

2:5 for lm and glm is the number of samples EE.., where 1 is intercept.

deleted 2 characters in body
Source Link
Deb
  • 319
  • 1
  • 5

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:28]5]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:28]5]))

However, I'm still looking for a suitable solution for extracting the variable importance table of rf_ranger random forest models.

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:28]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:28]))

However, I'm still looking for a suitable solution for extracting the variable importance table of rf_ranger random forest models.

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:5]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:5]))

However, I'm still looking for a suitable solution for extracting the variable importance table of rf_ranger random forest models.

added 40 characters in body
Source Link
Deb
  • 319
  • 1
  • 5

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:28]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:28]))

However, I'm still looking for a suitable solution for extracting the variable importance table of rf_ranger for random forest models.

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:28]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:28]))

However, I'm still looking for a suitable solution for rf_ranger for random forest models.

Well, I found a solution for lm and glm,

 coefs_lm<-as.data.frame(lapply(lm_model,function(x)coef(x)[2:28]))

 coefs_glm<-as.data.frame(lapply(glm_model,function(x)coef(x)[2:28]))

However, I'm still looking for a suitable solution for extracting the variable importance table of rf_ranger random forest models.

added 92 characters in body
Source Link
Deb
  • 319
  • 1
  • 5
Loading
Source Link
Deb
  • 319
  • 1
  • 5
Loading