Description Usage Arguments Value References Examples
An advanced interface for FTRL-Proximal online learning model cross validation.
1 2 3 4 |
data |
a object of class |
model |
a previously built model object to continue the training from. |
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. |
folds |
|
eval |
a custimized evaluation function, the first argument shoule be prediction, the second argument shoule be label. |
patience |
The number of rounds with no improvement in the evaluation metric in order to stop the training. User can specify 0 to disable early stopping. |
maximize |
whether to maximize the evaluation metric. |
nthread |
number of parallel threads used to run ftrl. Please set to 1 if your feature set is not sparse enough. |
verbose |
logical value. Indicating if the progress bar is displayed or not. |
a list with the following elements is returned:
dt
a data.table with each mean and standard deviation stat for training set and test set
pred
a numerical vector with predictions for each CV-fold for the model having been trained on the data in all other folds.
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 | library(FeatureHashing)
library(data.table)
library(rBayesianOptimization)
library(MLmetrics)
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))
ftrl_model_cv <- FTRLProx_cv(data = m.train, model = NULL,
family = "binomial",
params = list(alpha = 0.01, beta = 0.1,
l1 = 1.0, l2 = 1.0, dropout = 0), epoch = 50,
folds = KFold(as.numeric(ipinyou.train$IsClick), nfolds = 5,
stratified = FALSE, seed = 0),
eval = AUC, patience = 5, maximize = TRUE,
nthread = 1, verbose = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.