R/utils_splitSelect_construction.R

Defines functions construct.cv.splitSelect construct.splitSelect

# -----------------------------------------------------------------------
# Object Construction for splitSelect object
# 
# object: the splitSelect object
# fn_call: the function call
# x: the design matrix
# y: the response vector
# intercept: boolean for intercept or not
# family: the family for the errors and link function
construct.splitSelect <- function(object, fn_call, x, y, intercept=TRUE, family=family){
  class(object) <- append("splitSelect", class(object))
  object$num_splits <- nrow(object$splits)
  if(intercept)
    object$intercepts <- object$betas[1,]
  object$call <- fn_call
  object$family <- family
  return(object)
}

# -----------------------------------------------------------------------
# Object Construction for cv.splitSelect object
# 
# object: the cv.splitSelect object
# fn_call: the function call
# x: the design matrix
# y: the response vector
# intercept: boolean for intercept or not
# family: the family for the errors and link function
construct.cv.splitSelect <- function(object, fn_call, x, y, intercept=TRUE, family=family){
  class(object) <- append("cv.splitSelect", class(object))
  object$num_splits <- nrow(object$splits)
  if(intercept)
    object$intercepts <- object$betas[1,]
  object$call <- fn_call
  object$family <- family
  return(object)
}

Try the splitSelect package in your browser

Any scripts or data that you put into this service are public.

splitSelect documentation built on Nov. 9, 2021, 9:07 a.m.