Learn R Programming

IBLM (version 1.0.2)

data_beta_coeff_booster: Obtain Booster Model Beta Corrections for tabular data

Description

Creates dataframe of Shap beta corrections for each row and predictor variable of `data`

Usage

data_beta_coeff_booster(data, beta_corrections, iblm_model)

Value

A data frame with beta coefficient corrections. The structure will be the same dimension as `data` except for a "bias" column at the start.

Arguments

data

A data frame containing the dataset for analysis

beta_corrections

A data frame or matrix containing beta correction values for all variables and bias

iblm_model

Object of class 'iblm'

Examples

Run this code
df_list <- freMTPLmini |> split_into_train_validate_test(seed = 9000)

iblm_model <- train_iblm_xgb(
  df_list,
  response_var = "ClaimRate",
  family = "poisson"
)

explainer_outputs <- explain_iblm(iblm_model, df_list$test)

data_booster <- data_beta_coeff_booster(
  df_list$test,
  explainer_outputs$beta_corrections,
  iblm_model
)

data_booster |> dplyr::glimpse()

Run the code above in your browser using DataLab