[R] Different number of resamples error

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Feb 20 22:15:22 CET 2020


??
Isn't is resample()  not resamples()?
>From what package?
What package is bwplot from? lattice:::bwplot has no "metric" argument.



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Feb 20, 2020 at 12:55 PM javed khan <javedbtk111 using gmail.com> wrote:

> Hello to all
>
> I have different train functions for NN, SVM and GBM and when I combine the
> results using bwplot, it gives me the error " Different number of resamples
> in each model". It gives me the results (MAE values) but using the boxplot,
> it gives the error. The code is as follows:
>
> set.seed(30218)
> nnet1 <- train(results~ ., data = tr,
>                 method = "nnet",
>
>                 metric = "MAE",
>                 trControl = ctrl,
>
>                 preProc = c("center", "scale", "zv"),
>                 tuneGrid = data.frame(decay = (1),
>                                       size = (1.3801517)))
> nnet1$results
>
> ///For SVM
>
> set.seed(30218)
> svm1 <- train(results ~ ., data = tr,
>                     method = "svmRadial",
>
>                     metric = "MAE",
>                     preProc = c("center", "scale", "zv"),
>                     trControl = ctrl,
>               tuneGrid=expand.grid(sigma = (0.5),
>                                                 C = c(1.348657)))
> getTrainPerf(svm1)
> svm1$results
>
> //For GBM
>
> set.seed(30218)
> gbm <- train(results ~ ., data = tr,
>              method = "gbm",
>              preProc = c("center", "scale", "zv"),
>              metric = "MAE",
>
>
>              tuneGrid = data.frame(n.trees = (200.09633523),
> interaction.depth = (1),
>                                    shrinkage=(0.1), n.minobsinnode=(10)))
> gbm$results
>
> //Then the boxplot
>
> rvalues=resamples(list(nnet=nnet1, svm=svm1, GBM=gbm))
>
> bwplot(rvalues, metric="MAE")
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list