Learn R Programming

dynwrap (version 1.2.4)

add_feature_importance: 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)

Value

A dynwrap object with the feature importance added.

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

Examples

Run this code
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)

Run the code above in your browser using DataLab