R/RcppExports.R

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

#' Run Saga
#'
#' This function is here to template on the penalty
#'
#' @param control a list of control parameters
#' @param args a parameter pack that is passed to the call to Saga()
#'
#' @return see Saga()
#' @noRd
NULL

#' Setup sgdnet Model Options
#'
#' Collect parameters from `control` and setup storage for coefficients,
#' intercepts, gradients, and more so that we can iterate along the
#' regularization path using warm starts for successive iterations.
#'
#' @param x features
#' @param y response
#' @param family object of Family class
#' @param penalty object of Penalty class
#' @param is_sparse whether x is sparse or not
#' @param control a list of control parameters
#'
#' @return See [SgdnetCpp].
#'
#' @noRd
#' @keywords internal
NULL

#' Setup family
#'
#' This function serves as a portal to SetupSgdnet to provide
#' a Family object to template but first passes the result on to SetupPenalty
#'
#' @param x predictor matrix
#' @param y response matrix
#' @param family Object of family class
#' @param is_sparse whether or not x is sparse
#' @param control a Rcpp::List of control parameters
#' @noRd
NULL

#' Fit a Model with sgdnet
#'
#' This main use of this function is calling the templated SetupSgdnet()
#' so that the dense and sparse implementations are compiled and
#' called appropriately. The control parameters in `control` are just
#' passed along.
#'
#' @param x_in feature matrix
#' @param y response matrix
#' @param control a list of control parameters
#'
#' @return A list of
#'   * a0: the intercept,
#'   * beta: the weights,
#'   * losses: the loss at each outer iteration per fit,
#'   * npasses: the number of effective passes (epochs) accumulated over,
#'     all lambda values, and
#'   * return_codes: the convergence result. 0 means that the algorithm
#'     converged, 1 means that `max_iter` was reached before the algorithm
#'     converged.
#' @noRd
SgdnetDense <- function(x, y, control) {
    .Call(`_sgdnet_SgdnetDense`, x, y, control)
}

#' @noRd
SgdnetSparse <- function(x, y, control) {
    .Call(`_sgdnet_SgdnetSparse`, x, y, control)
}
jolars/sgdnet documentation built on May 22, 2019, 11:52 p.m.