Description Usage Arguments Value Examples
View source: R/FTRLProx_Hashing.R
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.
1 | FTRLProx_Hashing(formula = ~., data, hash.size, signed.hash, verbose = TRUE)
|
formula |
formula or a character vector of column names (will be expanded to a formula) |
data |
a |
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. |
an object of class "dgCMatrix"
1 2 3 4 5 6 7 | 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)
m.test <- FTRLProx_Hashing(~ 0 + ., ipinyou.test[,-"IsClick", with = FALSE],
hash.size = 2^13, signed.hash = FALSE, verbose = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.