safely_transform_data {rSAFE}R Documentation

Performing Transformations on All Features in the Dataset

Description

The safely_transform_data() function creates new variables in dataset using safe_extractor object.

Usage

safely_transform_data(safe_extractor, data, verbose = TRUE)

Arguments

safe_extractor

object containing information about variables transformations created with safe_extraction() function

data

data for which features are to be transformed

verbose

logical, if progress bar is to be printed

Value

data with extra columns containing newly created variables

See Also

safe_extraction, safely_select_variables

Examples


library(DALEX)
library(randomForest)
library(rSAFE)

data <- apartments[1:500,]
set.seed(111)
model_rf <- randomForest(m2.price ~ construction.year + surface + floor +
                           no.rooms + district, data = data)
explainer_rf <- explain(model_rf, data = data[,2:6], y = data[,1])
safe_extractor <- safe_extraction(explainer_rf, verbose = FALSE)
safely_transform_data(safe_extractor, data, verbose = FALSE)


[Package rSAFE version 0.1.4 Index]