FTRLProx_Model_Matrix: Construct Sparse Design Matrix for FTRL-Proximal Model

Description Usage Arguments Value Examples

View source: R/FTRLProx_Model_Matrix.R

Description

Construct a sparse model or "design" matrix, form a formula and data frame for FTRL-Proximal Algorithm. A wrapper of sparse.model.matrix function in the Matrix package. Please always use this function to generate sparse matrix for training and prediction.

Usage

1

Arguments

formula

a model formula.

data

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

label

a vector containing labels.

...

further arguments passed to sparse.model.matrix.

Value

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

Examples

1
2
3
4
5
6
library(data.table)
library(FeatureHashing)
data(ipinyou)
f <- ~ 0 + BidID + IP + City + AdExchange + BiddingPrice + PayingPrice
m.train <- FTRLProx_Model_Matrix(f, ipinyou.train[, -"IsClick", with = FALSE],
                                 label = as.numeric(ipinyou.train$IsClick))

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