cars.gb <- glmboost(dist ~ speed, data = cars,
control = boost_control(mstop = 5000))
cars.gb
#Number of boosting iterations: mstop = 5000
#Step size: 0.1
#Offset: 42.98
#Coefficients:
#(Intercept) speed
#-60.559044 3.932406
#attr(,"offset")
#[1] 42.98
################
x=cars$speed
y=cars$dist
mod1=glmboost(y~x,control = boost_control(mstop = 5000))
mod1
###############
library("Matrix")
x=cars$speed
x1=cbind(1,x)
xm=Matrix(x1)
y=cars$dist
mod2=glmboost(y = y, x = xm,control = boost_control(mstop = 5000))
mod2
#Number of boosting iterations: mstop = 5000
#Step size: 0.1
#Offset: 42.98
#Coefficients:
# x
#-60.559044 3.932406
#attr(,"offset")
#[1] 42.98


雷达卡
京公网安备 11010802022788号







