Skip to contents

Prepare rounded values for waterfall annotations while preserving the two displayed identities: feature contributions sum to the deviation, and the expected age plus the deviation equals the predicted age.

Usage

clockshap_waterfall_values(x, sample, top_n = 10, digits = 1)

Arguments

x

A clockshap object.

sample

A sample index (integer) or row name (character).

top_n

Number of top absolute contributions to display.

digits

Number of decimal places used for all numeric labels.

Value

A list containing the displayed expected, predicted, deviation, and named contributions values.

Details

To preserve exact arithmetic after rounding, an endpoint or contribution label may differ from independently rounding its stored value by one unit in the last displayed decimal place.