阅读背景:

如何使用ggplot为resample类创建一个点图等效图表

来源:互联网 

Consider the following code:

请考虑以下代码:

#Load Data
set.seed(42)
require(mlbench)
data(BostonHousing)
y <- BostonHousing[,14]
X <- BostonHousing[,1:13]

#Use the same CV-folds for each model
require(caret)
myControl <- trainControl(method='cv', number=10, index=createFolds(y, k=10))

#Fit models
model_rpart <- train(X, y, method='rpart', trControl=myControl)
model_ctree <- train(X, y, method='ctree', trControl=myControl)
model_rf <- train(X, y, method='rf', trControl=myControl)

#Plot
resamples <- resamples(list(
rpart=model_rpart,
ctree=model_ctree,
model_rf=model_rf
))

dotplot(resamples, metric='RMSE')
#Load



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: