bagging_fit1: Function that implement one resample of Bagging in regression

Description Usage Arguments Value Examples

View source: R/bagging.R

Description

Function that implement one resample of Bagging in regression

Usage

1

Arguments

fweak

- function that generates estimate from weak model based on input

data

- list of data that fweak need

Value

A trained model function based on the one implementation of the weak model, whose input is the independent variables.

Examples

1
2
3
4
5
6
fweak <- function(x, y){
  lm(y ~ -1 + x)$coefficients
}
data <- list(x = matrix(rnorm(1000), 200, 5))
data$y <- data$x %*% rnorm(5) + rnorm(200, 0, 3)
bagging_fit1(fweak, data)

StevenBoys/Ensemblelearn documentation built on Dec. 11, 2019, 2:06 a.m.