楼主: ywh19860616
14517 15

[问答] 如何使用命令查看boston数据 [推广有奖]

11
epoh 发表于 2011-7-9 13:54:39
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
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 非常感谢您,老师 这两种算法很神奇,不过一个速度很慢

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

12
ywh19860616 发表于 2011-7-9 14:47:50
epoh老师,谢谢您了。
又学到了知识了
一份耕耘,一份收获。

13
epoh 发表于 2011-7-9 22:20:44
ibrary("Matrix")
cars.gb <- glmboost(dist ~ -1+speed, data = cars,
           control = boost_control(mstop = 5000),center = TRUE)
cars.gb
#Number of boosting iterations: mstop = 5000
#Step size:  0.1
#Offset:  42.98

#Coefficients:
#   speed
#3.932409
#attr(,"offset")
#[1] 42.98


########
########
#1. center the design matrix for much quicker "convergence"
#2. need not contain intercept
x=cars$speed
xm=Matrix(x)
y=cars$dist
mod2=glmboost(y = y, x = xm,control = boost_control(mstop = 5000),center = TRUE)### mstop needs tuning
mod2
#Number of boosting iterations: mstop = 5000
#Step size:  0.1
#Offset:  42.98

#Coefficients:
#      V1
#3.932409
#attr(,"offset")
#[1] 42.98
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 epoh老师,谢谢您,已经知晓了 哈哈,又麻烦您那么久

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

14
ywh19860616 发表于 2011-7-9 22:51:52
谢谢epoh老师,经过您的指导,已经知晓
一份耕耘,一份收获。

15
楚韵荆风 学生认证  发表于 2011-7-11 11:08:43
3# zhangtao

貌似就是:近似的剖面似然估计,Jianqing Fan有篇文章写的是这个
共享是一种彼此的快乐

16
xlk75 发表于 2011-8-4 23:56:43



我收藏了,努力学习啊!!
风神时代

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 23:10