交叉验证集的插入符号 [英] caret coefficients of cross validated set

查看:104
本文介绍了交叉验证集的插入符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从R Caret包中获取所有交叉验证集的系数?

Is it possible to get the coefficients of all the cross validation set from R Caret package?

set.seed(1)
mu <- rep(0, 4)
Sigma <- matrix(.7, nrow=4, ncol=4) 
diag(Sigma)  <-  1
rawvars <- mvrnorm(n=1000, mu=mu, Sigma=Sigma)
d  <- as.ordered( 
  as.numeric(rawvars[,1]>0.5) )
d[1:200]  <- 1
df  <- data.frame(rawvars, d)
ind  <- sample(1:nrow(df), 500)
train  <- df[ind,]
test  <- df[-ind,]
trControl  <- trainControl(method = "repeatedcv",
                           repeats = 1,
                           classProb = T,
                           summaryFunction= twoClassSummary)
fit.caret  <- train(d~., data=train,
                    method="glm",
                    family = binomial(link="probit"), trControl =trControl)
> fit.caret$resample
         ROC      Sens      Spec    Resample
1  0.8383838 0.8148148 0.7272727 Fold01.Rep1
2  0.8881988 0.8571429 0.7391304 Fold02.Rep1
3  0.8937198 0.8518519 0.7826087 Fold03.Rep1
4  0.8792271 0.7407407 0.8260870 Fold04.Rep1
5  0.8771044 0.8888889 0.7727273 Fold05.Rep1
6  0.8703704 0.6666667 0.7727273 Fold06.Rep1
7  0.9145963 0.8928571 0.8260870 Fold07.Rep1
8  0.8649068 0.6785714 0.8260870 Fold08.Rep1
9  0.8084416 0.8928571 0.6818182 Fold09.Rep1
10 0.7938312 0.7857143 0.6363636 Fold10.Rep1

我有每次重复的ROC,但是每次运行我都需要系数

I have the ROCs for each repetition, but I also need coefficients for each run

推荐答案

不是。我们从保留的数据集中存储的内容很少。

Not really. We don't store much from the held-out data sets.

您可以编写自定义模型保存模型对象(通过保存),您可以从那里获取系数。

You could write a custom model that saves the model object (via save) and you can get the coefficients from there.

最大

这篇关于交叉验证集的插入符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆