dt2vw: Create a vw data file from a R data.frame object

Description Usage Arguments

Description

Create a vw data file from a R data.frame object

Usage

1
2
dt2vw(data, fileName, namespaces = NULL, target, weight = NULL,
  tag = NULL, hard_parse = FALSE, append = FALSE)

Arguments

data

[data.table] data.table format (to be transformed)

fileName

[string] file name of the resulting data in VW-friendly format

namespaces

[list / yaml file] name of each namespace and each variable for each namespace can be a R list, or a YAML file example namespace with the IRIS database: namespaces = list(sepal = list(varName = c('Sepal.Length', 'Sepal.Width'), keepSpace=F), petal = list(varName = c('Petal.Length', 'Petal.Width'), keepSpace=F)) this creates 2 namespaces (sepal and petal) containing the variables defined by varName. keepSpace allows to keep or remove spaces in categorical variables example: "FERRARI 4Si" ==> "FERRARI_4Si" with keepSpace = F ==> "FERRARI 4Si" with keepSpace = T (interpreted by VW as two distinct categorical variables)

target

[string] target of the data (target)

weight

[string] weight of each line of the dataset (importance)

tag

[string] tag of each line of the dataset

hard_parse

[bool] if equals true, parses the data more strictly to avoid feeding VW with false categorical variables like '_', or same variables perceived differently like "_var" and "var"

append

[bool] data to be appended to result file


SelimRaboudi/Rvw documentation built on May 9, 2019, 1:20 p.m.