Skip to contents

Swaps each feature for its reference value (the feature spec's impute, else 0) and reports the change in the final calibrated probability as the feature's impact (positive = pushes risk up). Model-agnostic one-at-a-time occlusion, not interaction-aware TreeSHAP. Mirror of Python omop_etl.model_bundle.explain_rows.

Usage

explain_rows(bundle, features, top_k = 5L)

Arguments

bundle

A model_bundle or bundle directory.

features

data.frame holding the bundle's feature columns (already imputed, no NA).

top_k

Number of drivers per row.

Value

A list (one element per row) of lists with feature, name, value, impact, ordered by absolute impact.