mrFlashlight: mrFlashlight: Wrapper to run multi-response model agnostic...

View source: R/MrFlashLight.R

mrFlashlightR Documentation

mrFlashlight: Wrapper to run multi-response model agnostic interpretable machine learning analyses.

Description

mrFlashlight: Wrapper to run multi-response model agnostic interpretable machine learning analyses.

Usage

mrFlashlight(
  yhats,
  X,
  X1,
  Y,
  response = "multi",
  index = 1,
  mode = "regression",
  predict_function = NULL
)

Arguments

yhats

A list is the list generated by mrIMLpredicts

X

A dataframe is the feature data set

Y

A dataframe is a response variable data set (species, OTUs, SNPs etc)

response

character single' selects one response, 'multi' selects all responses

index

numeric selects which response to create a flashlight object for. Only used when 'single' is selected. The order is the same as 'Y'.

mode

character'classification' or 'regression' i.e., is the generative model a regression or classification?

predict_function

function user specified predict function

Details

The aim of this function is to enable users to utilize interpretable machine learning methods to understand their multi-response and single response models

Examples

#single response
fl <- mrFlashlight(yhats, X, Y, response = "single", index=1, mode = "regression")

plot(light_performance(fl), fill = "orange") + labs(x = element_blank())

plot(light_breakdown(fl , new_obs = cbind(X, Y)[1, ]),by = X, v=Y) #prints all responses - need to fix but could be quite handy.

int <- light_interaction(fl, pairwise=TRUE) #not working, but possible!

Multiple response
flashlightObj <- mrFlashlight(yhats, X, Y, response = "multi", mode='regression')

nfj1380/mrIML documentation built on May 17, 2024, 7:41 a.m.