View source: R/mid_importance.R
mid.importance | R Documentation |
mid.importance()
calculates the MID importance of a fitted MID model.
This is a measure of feature importance that quantifies the average contribution of each component function across a dataset.
mid.importance(object, data = NULL, weights = NULL, sort = TRUE, measure = 1L)
object |
a "mid" object. |
data |
a data frame containing the observations to calculate the importance. If |
weights |
an optional numeric vector of sample weights. |
sort |
logical. If |
measure |
an integer specifying the measure of importance. Possible alternatives are |
The MID importance of a component function (e.g., a main effect or an interaction) is defined as the mean absolute effect on the predictions within the given data. Terms with higher importance have a larger average impact on the model's overall predictions.
mid.importance()
returns an object of class "mid.importance". This is a list containing the following components:
importance |
a data frame with the calculated importance values, sorted by default. |
predictions |
the matrix of the fitted or predicted MID values. |
measure |
a character string describing the type of the importance measure used. |
interpret
, plot.mid.importance
, ggmid.mid.importance
data(airquality, package = "datasets")
mid <- interpret(Ozone ~ .^2, data = airquality, lambda = 1)
# Calculate MID importance using median absolute contribution
imp <- mid.importance(mid)
print(imp)
# Calculate MID importance using root mean square contribution
imp <- mid.importance(mid, measure = 2)
print(imp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.