Description Usage Arguments Value Examples

This function calculates local variable importance (variable drop-out) by finding top_n observations closest to the explained instance, performing permutation variable importance and using weighted mean square error as loss function with weights equal to 1 - Gower distances of the closest observations to the explainedi instance.

1 2 | ```
local_permutation_importance(explained_instance, data, explained_var,
model, top_n = nrow(data))
``` |

`explained_instance` |
Data frame with one observation for which prediction will be explained |

`data` |
Data from with the same columns as explained_instance |

`explained_var` |
Character with the names of response variable |

`model` |
Model to be explained |

`top_n` |
Number of observation that will be used to calculate local variable importance |

list of class "local_permutation_importance" that consists of

`residuals` |
Data frame with names of variables in the dataset ("label") and values of drop-out loss ("dropout_loss") |

`weighted_local_mse` |
Value of weighted MSE for the whole dataset with weights given by 1 - Gower distance from the explained instance |

`explained_instance` |
Explained instance as a data frame |

1 2 3 4 5 6 | ```
## Not run:
local_permutation_importance(wine[5, ], wine,
randomForest(quality~., data = wine),
top_n = 1000)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.