save_features: Save features

Description Usage Arguments Examples

View source: R/save_features.R

Description

Used to save all or a subset of features created during dfs.

Usage

1
save_features(.data, filename = NA, path = NA)

Arguments

.data

The tibble of features returned from extract_features.

filename

(optional) The name of the file to produce.

path

(optional) The path where the feature file should be placed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(magrittr)
set_1 <- data.frame(key = 1:100, value = sample(letters, 100, TRUE), stringsAsFactors = TRUE)
set_2 <- data.frame(key = 1:100, value = sample(LETTERS, 100, TRUE), stringsAsFactors = TRUE)
# Common variable: `key`

dir <- tempdir()
as_entityset(set_1, index = "key", entity_id = "set_1", id = "demo") %>%
  add_entity(entity_id = "set_2", df = set_2, index = "key") %>%
  add_relationship(
    parent_set = "set_1",
    child_set = "set_2",
    parent_idx = "key",
    child_idx = "key"
  ) %>%
  dfs(target_entity = "set_1", trans_primitives = c("and")) %>%
  extract_features() %>%
  save_features(filename = "some.features", path = dir)

featuretoolsR documentation built on April 25, 2020, 5:05 p.m.