如何对 R 中的预测数据应用 wilcox 检验?
How to apply wilcox test on the predicted data in R?
当我们有一个数据文件时,我们使用以下代码进行 k 折交叉验证训练数据,
set.seed(308)
rand_search <- train(
Effort ~ ., data = d,
method = "svmRadial",
##Create 20 random parameter values
tuneLength = 20,
metric = "RMSE",
preProc = c("center", "scale"),
trControl = rand_ctrl
)
model1 <- predict(rand_search, newdata = test1)
And another search algorithm like grid
grid_search <- train(
Effort ~ ., data = d,
method = "svmRadial",
##Create 20 random parameter values
tuneLength = 20,
metric = "RMSE",
preProc = c("center", "scale"),
trControl = rand_ctrl
)
model2 <- predict(grid_search, newdata = test1)
我的问题是如果我们必须找到显着性检验(wilcox检验),我们如何应用它?我们是否需要像下面那样将模式 1 和模式 2 传递给 wilcox 测试?
wilcox.test(模型 1,模型 2)
在trainControl
中不需要指定数据。在 train
函数中,您必须提及
之类的数据
#Model training
set.seed(308)
rand_search <- train(Effort ~ ., data = train1 ,
method = "svmRadial",
## Create 20 random parameter values
tuneLength = 20,
metric = "RMSE",
preProc = c("center", "scale"),
trControl = rand_ctrl)
并且 test1
应该用于预测目的,例如
#For calibration
models_cal <- predict(rand_search, newdata = train1)
#For independent validation
models_val <- predict(rand_search, newdata = test1)
当我们有一个数据文件时,我们使用以下代码进行 k 折交叉验证训练数据,
set.seed(308)
rand_search <- train(
Effort ~ ., data = d,
method = "svmRadial",
##Create 20 random parameter values
tuneLength = 20,
metric = "RMSE",
preProc = c("center", "scale"),
trControl = rand_ctrl
)
model1 <- predict(rand_search, newdata = test1)
And another search algorithm like grid
grid_search <- train(
Effort ~ ., data = d,
method = "svmRadial",
##Create 20 random parameter values
tuneLength = 20,
metric = "RMSE",
preProc = c("center", "scale"),
trControl = rand_ctrl
)
model2 <- predict(grid_search, newdata = test1)
我的问题是如果我们必须找到显着性检验(wilcox检验),我们如何应用它?我们是否需要像下面那样将模式 1 和模式 2 传递给 wilcox 测试?
wilcox.test(模型 1,模型 2)
在trainControl
中不需要指定数据。在 train
函数中,您必须提及
#Model training
set.seed(308)
rand_search <- train(Effort ~ ., data = train1 ,
method = "svmRadial",
## Create 20 random parameter values
tuneLength = 20,
metric = "RMSE",
preProc = c("center", "scale"),
trControl = rand_ctrl)
并且 test1
应该用于预测目的,例如
#For calibration
models_cal <- predict(rand_search, newdata = train1)
#For independent validation
models_val <- predict(rand_search, newdata = test1)