R/getBestModel.R

Defines functions getBestModel

Documented in getBestModel

#' Extracting the wrapped model of the best performing features from a spFSR object
#'
#' A fitted model uses the best performing feature subsets. It inherits all methods or functions applied to a \code{WrappedModel} objects. For example, the \code{predict} function can be used on the fitted model. See \link[spFSR]{spFeatureSelection} for example.
#'
#' @param x a \code{spFSR} object
#' @return A \code{WrappedModel} object of the best performing features.

#'
#' @seealso \link[spFSR]{spFeatureSelection}
#'
#'
#' @export
getBestModel <- function(x){
  if( !inherits(x, 'spFSR')  ){
    stop('Not a spFSR object.')
  }
  x$best.model
}

Try the spFSR package in your browser

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

spFSR documentation built on March 31, 2023, 9:05 p.m.