FTRLProx_Hashing: Feature Hashing for FTRL-Proximal Model

Description Usage Arguments Value Examples

View source: R/FTRLProx_Hashing.R

Description

Feature Hashing for FTRL-Proximal Algorithm. A wrapper of hashed.model.matrix function in the FeatureHashing package. Please always use this function to generate sparse matrix for training and prediction.

Usage

1
2
FTRLProx_Hashing(formula = ~., data, hash.size, signed.hash, verbose = TRUE,
  label = NULL)

Arguments

formula

formula or a character vector of column names (will be expanded to a formula)

data

a data.frame or data.table. The original data.

hash.size

positive integer. The hash size of feature hashing.

signed.hash

logical value. Indicating if the hashed value is multipled by random sign. This will reduce the impact of collision. Disable it will enhance the speed.

verbose

logical value. Indicating if the progress bar is displayed or not.

label

a vector containing labels.

Value

constructed dataset, an object of class "ftrl.Dataset"

Examples

1
2
3
4
5
6
7
8
9
library(data.table)
library(FeatureHashing)
data(ipinyou)
m.train <- FTRLProx_Hashing(~ 0 + ., ipinyou.train[, -"IsClick", with = FALSE],
                            hash.size = 2^13, signed.hash = FALSE, verbose = TRUE,
                            label = as.numeric(ipinyou.train$IsClick))
m.test <- FTRLProx_Hashing(~ 0 + ., ipinyou.test[,-"IsClick", with = FALSE],
                           hash.size = 2^13, signed.hash = FALSE, verbose = TRUE,
                           label = as.numeric(ipinyou.test$IsClick))

yanyachen/rFTRLProximal documentation built on May 4, 2019, 2:30 p.m.