/usr/share/doc/r-cran-caret/tests/testthat/test_multiclassSummary.R is in r-cran-caret 6.0-78+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | context('multiClassSummary')
test_that("multiClassSummary presenting warnings from train", {
library(caret)
N = 1000;
M = 2;
set.seed(1)
xTrain = matrix( runif(N*M), nrow = N);
colnames(xTrain) <-
sapply(1:M, function(u) paste0(collapse = '', letters[sample(26, 3, replace = TRUE)] ) )
yTrain = as.factor( letters[sample(3, N, replace = TRUE)])
trCntlListMulti <- trainControl(method = "cv", number = 3, verboseIter = FALSE, classProbs = TRUE,
summaryFunction = multiClassSummary )
expect_silent({
enFitMulti <-
train( x = xTrain, y = yTrain, trControl = trCntlListMulti,
method = "knn", tuneLength = 2 )
})
})
|