Package maidrr

maidrr-package

maidrr: Model-Agnostic Interpretable Data-driven suRRogate

Datasets included

mtpl_be

Belgian motor third party liability insurance portfolio

mtpl_fr

French motor third party liability insurance portfolio

Automatic tuning via cross-validation

This function automates the tuning process involved in steps 1-3 below in order to find the optimal data segmentation and surrogate GLM.

autotune()

Automatic tuning

Helper functions

lambda_grid()

Lambda grid

err_fun() poi_dev() mse() wgt_mse()

Predefined error functions

rm_lvls()

Drop unused factor levels

1) Obtaining model insights

insights()

Model insights

Helper functions

get_vi()

Calculate variable importance

plot_vi()

Plot variable importance

get_grid()

Get feature grid

get_pd()

Calculate partial dependence

plot_pd()

Plot partial dependence

interaction_pd()

Pure two-way interaction

interaction_strength()

Calculate interaction strength

2) Segmentation of the data

segmentation()

Data segmentation

Helper functions

group_pd() group_pd_ckseg() group_pd_ckmns()

Partial dependence grouping

optimal_ngroups()

Optimal number of groups

3) Fitting a GLM surrogate

surrogate()

Surrogate GLM

4) Explaining a prediction

explain()

Explain predictions