R/GetInteractionStrength.R

Defines functions GetInteractionStrength

Documented in GetInteractionStrength

#' @importFrom utils combn 

#' @export

GetInteractionStrength <- function(object, xnames=NULL) {
  input = object@data@get("input")
  if(is.null(xnames)) xnames = colnames(input)
  combi <- utils::combn(xnames,2,simplify=F)
  foo <- function(x) vip_vint(object, feature_names=x, quantiles=TRUE)
  res <- lapply(combi, foo)
  vint <- do.call('rbind.data.frame',res)
  vint <- vint[order(-vint$Interaction),]
  return(vint)
}

Try the moreparty package in your browser

Any scripts or data that you put into this service are public.

moreparty documentation built on Nov. 22, 2023, 5:08 p.m.