View source: R/shapley_approx.R
shapley_approx | R Documentation |
Approximates Shapley Values for a set of items. Shapley Values measure the relative contribution each item has to the overall potential reach if every item was included.
shapley_approx(
data,
items,
case_weights,
item_weights,
depth = 1,
return = "vector"
)
data |
A data frame. |
items |
Columns on which to analyze. Must contain only ones, zeros, or
|
case_weights |
An optional column of case weights to use in the
calculations. Rows with |
item_weights |
An optional named vector of non-zero weights to associate with each item. Items not specified will be given a default weight of 1. Examples could be profit, revenue, or simply relative weights. |
depth |
Number of |
return |
One of |
shapley_approx(
data = FoodSample,
items = Bisque:Chili,
case_weights = weight,
item_weights = c(Bisque = 9.99, Chicken = 10.29, Tofu = 10.99, Chili = 7.49),
depth = 1,
return = "tibble"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.