add_feature_importance: Add a feature importance to a dataset

View source: R/wrap_add_feature_importance.R

add_feature_importanceR Documentation

Add a feature importance to a dataset

Description

Add a feature importance to a dataset

Usage

add_feature_importance(dataset, feature_importance, ...)

is_wrapper_with_feature_importance(dataset)

Arguments

dataset

A dataset created by wrap_data() or wrap_expression()

feature_importance

The impotances of the features, can be a named vector or a dataframe with columns feature_id and importance

...

Extra information to be stored in the dataset

Value

A dynwrap object with the feature importance added.

Examples

dataset <- example_dataset

feature_importance <- runif(nrow(dataset$feature_info))
names(feature_importance) <- dataset$feature_info$feature_id

dataset <- add_feature_importance(dataset, feature_importance)
head(dataset$feature_importance)


dynwrap documentation built on July 26, 2023, 5:15 p.m.