R/RcppExports.R

Defines functions set_omp_threads get_omp_threads predict_spMatrix FTRLProx_train_spMatrix

Documented in FTRLProx_train_spMatrix predict_spMatrix

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

set_omp_threads <- function(n) {
    invisible(.Call('rFTRLProximal_set_omp_threads', PACKAGE = 'rFTRLProximal', n))
}

get_omp_threads <- function() {
    .Call('rFTRLProximal_get_omp_threads', PACKAGE = 'rFTRLProximal')
}

#' @title FTRL-Proximal Linear Model Predicting Function
#'
#' @description
#' predict_spMatrix predicts values based on linear model weights.
#' This function is an C++ implementation.
#' This function is used internally and is not intended for end-user direct usage.
#'
#' @param x a transposed \code{dgCMatrix} object.
#' @param w a vector of linear model weights.
#' @param family link function to be used in the model. "gaussian", "binomial" and "poisson" are avaliable.
#' @return a vector of linear model predicted values.
#' @keywords internal
#' @export
predict_spMatrix <- function(x, w, family) {
    .Call('rFTRLProximal_predict_spMatrix', PACKAGE = 'rFTRLProximal', x, w, family)
}

#' @title FTRL-Proximal Linear Model Fitting Function
#'
#' @description
#' FTRLProx_train_spMatrix estimates the weights of linear model using FTRL-Proximal Algorithm.
#' This function is an C++ implementation.
#' This function is used internally and is not intended for end-user direct usage.
#'
#' @param x a transposed \code{dgCMatrix}.
#' @param y a vector containing labels.
#' @param state a previously built model state to continue the training from.
#' @param family link function to be used in the model. "gaussian", "binomial" and "poisson" are avaliable.
#' @param params a list of parameters of FTRL-Proximal Algorithm.
#' \itemize{
#'   \item \code{alpha} alpha in the per-coordinate learning rate
#'   \item \code{beta} beta in the per-coordinate learning rate
#'   \item \code{l1} L1 regularization parameter
#'   \item \code{l2} L2 regularization parameter
#'   \item \code{dropout} percentage of the input features to drop from each sample
#' }
#' @param epoch The number of iterations over training data to train the model.
#' @param nthread number of parallel threads used to run ftrl.
#' @param verbose logical value. Indicating if the progress bar is displayed or not.
#' @return a list of ftrl model state.
#' @keywords internal
#' @export
FTRLProx_train_spMatrix <- function(x, y, state, family, params, epoch, nthread, verbose) {
    .Call('rFTRLProximal_FTRLProx_train_spMatrix', PACKAGE = 'rFTRLProximal', x, y, state, family, params, epoch, nthread, verbose)
}
yanyachen/rFTRLProximal documentation built on May 4, 2019, 2:30 p.m.