Description Usage Arguments Value References Examples
View source: R/FTRLProx_train.R
An advanced interface for training FTRL-Proximal online learning model.
1 2 3 |
x |
a transposed |
y |
a vector containing labels. |
family |
link function to be used in the model. "gaussian", "binomial" and "poisson" are avaliable. |
params |
a list of parameters of FTRL-Proximal Algorithm.
|
epoch |
The number of iterations over training data to train the model. |
bagging_seeds |
a vector containing random seeds for shuffling data. If provided, use parallel foreach to fit each model. Must register parallel before hand, such as doParallel or others. |
verbose |
logical value. Indicating if the progress bar is displayed or not. |
a FTRL-Proximal linear model object
H. B. McMahan, G. Holt, D. Sculley, et al. "Ad click prediction: a view from the trenches". In: _The 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD 2013, Chicago, IL, USA, August 11-14, 2013_. Ed. by I. S.Dhillon, Y. Koren, R. Ghani, T. E. Senator, P. Bradley, R. Parekh, J. He, R. L. Grossman and R. Uthurusamy. ACM, 2013, pp. 1222-1230. DOI: 10.1145/2487575.2488200. <URL: http://doi.acm.org/10.1145/2487575.2488200>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(data.table)
library(FeatureHashing)
library(MLmetrics)
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)
ftrl_model <- FTRLProx_train(m.train, y = as.numeric(ipinyou.train$IsClick),
family = "binomial",
params = list(alpha = 0.01, beta = 0.1, l1 = 1.0, l2 = 1.0),
epoch = 10, verbose = TRUE)
ftrl_model_bagging <- FTRLProx_train(m.train, y = as.numeric(ipinyou.train$IsClick),
family = "binomial",
params = list(alpha = 0.01, beta = 0.1, l1 = 1.0, l2 = 1.0),
epoch = 10, bagging_seeds = 1:10, verbose = FALSE)
pred_ftrl <- FTRLProx_predict(ftrl_model, newx = m.test)
pred_ftrl_bagging <- FTRLProx_predict(ftrl_model_bagging, newx = m.test)
AUC(pred_ftrl, as.numeric(ipinyou.test$IsClick))
AUC(pred_ftrl_bagging, as.numeric(ipinyou.test$IsClick))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.