Description Usage Arguments Value Examples
View source: R/FTRLProx_Model_Matrix.R
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.
1 | FTRLProx_Model_Matrix(formula = ~., data, label = NULL, ...)
|
formula |
a model formula. |
data |
a |
label |
a vector containing labels. |
... |
further arguments passed to |
constructed dataset, an object of class "ftrl.Dataset"
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.