Last updated on 2019-04-22 07:46:36 CEST.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 0.1-2 | 9.13 | 101.47 | 110.60 | ERROR | |
r-devel-linux-x86_64-debian-gcc | 0.1-2 | 7.40 | 78.52 | 85.92 | ERROR | |
r-devel-linux-x86_64-fedora-clang | 0.1-2 | 127.54 | ERROR | |||
r-devel-linux-x86_64-fedora-gcc | 0.1-2 | 123.79 | ERROR | |||
r-devel-windows-ix86+x86_64 | 0.1-2 | 23.00 | 113.00 | 136.00 | ERROR | |
r-patched-linux-x86_64 | 0.1-2 | 8.55 | 99.59 | 108.14 | ERROR | |
r-patched-solaris-x86 | 0.1-2 | 198.70 | ERROR | |||
r-release-linux-x86_64 | 0.1-2 | 4.34 | 83.16 | 87.50 | NOTE | |
r-release-windows-ix86+x86_64 | 0.1-2 | 11.00 | 129.00 | 140.00 | NOTE | |
r-release-osx-x86_64 | 0.1-2 | NOTE | ||||
r-oldrel-windows-ix86+x86_64 | 0.1-2 | 18.00 | 134.00 | 152.00 | NOTE | |
r-oldrel-osx-x86_64 | 0.1-2 | NOTE |
Version: 0.1-2
Check: R code for possible problems
Result: NOTE
.boxRadial: no visible global function definition for 'predict'
.radialSVM: no visible global function definition for 'predict'
cfPredict: no visible global function definition for 'predict'
getPerm5Num: no visible global function definition for 'median'
getPerm5Num: no visible global function definition for 'quantile'
ggClassPred: no visible global function definition for 'ftable'
ggEnsHist: no visible global function definition for 'sd'
ggPermHist: no visible global function definition for 'sd'
Undefined global functions or variables:
ftable median predict quantile sd
Consider adding
importFrom("stats", "ftable", "median", "predict", "quantile", "sd")
to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64
Version: 0.1-2
Check: tests
Result: ERROR
Running 'UnitTestingClassyfire.R' [29s/31s]
Running the tests in 'tests/UnitTestingClassyfire.R' failed.
Complete output:
> # **************************************************************************************************************
> # Functions for unit testing
> # **************************************************************************************************************
>
> library('RUnit')
> library('classyfire')
Loading required package: snowfall
Loading required package: snow
Loading required package: e1071
Loading required package: boot
Loading required package: neldermead
Loading required package: optimbase
Loading required package: Matrix
Loading required package: optimsimplex
>
> set.seed(1)
>
> # Test data
> data(iris)
> irisClass <- iris[,5]
> irisData <- iris[,-5]
> randClass <- c(2, rep(3, length(irisClass)-1))
> testVec <- t(c(62,20,68,76))
>
> # Use parallel = FALSE for testing on CRAN!
> ensObj <- cfBuild(inputData = irisData, inputClass = irisClass, bootNum = 5, ensNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> permObj <- cfPermute(irisData, irisClass, bootNum = 5, ensNum = 2, permNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> predRes <- cfPredict(ensObj , testVec)
>
>
> # Test the initial checks on the input data provided by the user etc.
> test.initCheck <- function() {
+ checkException(.initCheck(), silent=TRUE)
+ checkException(.initCheck(irisData), silent=TRUE)
+ checkException(.initCheck(inputClass = inputClass), silent=TRUE)
+ checkException(.initCheck(iris, irisClass), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, randClass), silent=TRUE)
+ }
>
> # Test the main cfBuild function for the construction of the ensemble
> test.cfBuild <- function() {
+ checkEquals("cfBuild", class(ensObj)[2])
+ checkEquals(13, length(ensObj))
+ checkEquals(95.1, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals(92.16, ensObj$testAcc[1])
+ checkEquals(96.97, ensObj$trainAcc[1])
+ checkEquals(TRUE, any(attributes(ensObj)$names == "testAcc"))
+ checkEquals(100, getConfMatr(ensObj)[1,1])
+ checkEquals(94, getConfMatr(ensObj)[2,2])
+ checkEquals(91, getConfMatr(ensObj)[3,3])
+ }
>
> # Test the cfPermute function for permutation testing
> test.cfPermute <- function() {
+ checkEquals("cfPermute", class(permObj)[2])
+ checkEquals(4, length(permObj))
+ checkEquals(39.22, permObj$avgAcc[1])
+ checkEquals(2, length(permObj$permList))
+ }
>
> # Test the cfPredict function for use with unknown data
> test.cfPredict <- function() {
+ checkEquals("virginica", as.character(predRes[,1]))
+ checkEquals(100, predRes[,2])
+ }
>
> # Test the relevant stats functions
> test.stats <- function() {
+ checkException(getAcc(), silent=TRUE)
+ checkException(getAvgAcc(), silent=TRUE)
+ checkException(getOptParam(), silent=TRUE)
+ checkException(getConfMatr(), silent=TRUE)
+ checkException(getPerm5Num(), silent=TRUE)
+
+ checkException(getAcc(randClass), silent=TRUE)
+ checkException(getAvgAcc(randClass), silent=TRUE)
+ checkException(getOptParam(randClass), silent=TRUE)
+ checkException(getConfMatr(randClass), silent=TRUE)
+ checkException(getPerm5Num(randClass), silent=TRUE)
+
+ checkEquals(2, length(getAcc(ensObj)))
+ checkEquals(2, length(getAvgAcc(ensObj)))
+ checkEquals(92.16, getAcc(ensObj)$Test[1])
+ checkEquals(96.97, getAcc(ensObj)$Train[1])
+ checkEquals(95.10, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals("matrix", class(getOptParam(ensObj)))
+ checkEquals("table", class(getConfMatr(ensObj)))
+ checkEquals(9, length(getConfMatr(ensObj)))
+ checkEquals(5, length(getPerm5Num(permObj)))
+ checkEquals(33.33, getPerm5Num(permObj)$minimum)
+ }
>
> # Test the relevant plot functions
> test.plots <- function() {
+ checkException(ggEnsTrend(), silent=TRUE)
+ checkException(ggEnsHist(), silent=TRUE)
+ checkException(ggClassPred(), silent=TRUE)
+ checkException(ggPermHist(), silent=TRUE)
+
+ checkException(ggEnsTrend(permObj), silent=TRUE)
+ checkException(ggEnsHist(permObj), silent=TRUE)
+ checkException(ggClassPred(permObj), silent=TRUE)
+ checkException(ggPermHist(ensObj), silent=TRUE)
+ }
>
> # Execute all the tests
> test.initCheck()
[1] TRUE
> test.cfBuild()
Error in checkEquals(96.97, getAvgAcc(ensObj)$Train) :
Mean relative difference: 0.005156234
Calls: test.cfBuild -> checkEquals
Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-patched-linux-x86_64
Version: 0.1-2
Check: tests
Result: ERROR
Running ‘UnitTestingClassyfire.R’ [21s/26s]
Running the tests in ‘tests/UnitTestingClassyfire.R’ failed.
Complete output:
> # **************************************************************************************************************
> # Functions for unit testing
> # **************************************************************************************************************
>
> library('RUnit')
> library('classyfire')
Loading required package: snowfall
Loading required package: snow
Loading required package: e1071
Loading required package: boot
Loading required package: neldermead
Loading required package: optimbase
Loading required package: Matrix
Loading required package: optimsimplex
>
> set.seed(1)
>
> # Test data
> data(iris)
> irisClass <- iris[,5]
> irisData <- iris[,-5]
> randClass <- c(2, rep(3, length(irisClass)-1))
> testVec <- t(c(62,20,68,76))
>
> # Use parallel = FALSE for testing on CRAN!
> ensObj <- cfBuild(inputData = irisData, inputClass = irisClass, bootNum = 5, ensNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> permObj <- cfPermute(irisData, irisClass, bootNum = 5, ensNum = 2, permNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> predRes <- cfPredict(ensObj , testVec)
>
>
> # Test the initial checks on the input data provided by the user etc.
> test.initCheck <- function() {
+ checkException(.initCheck(), silent=TRUE)
+ checkException(.initCheck(irisData), silent=TRUE)
+ checkException(.initCheck(inputClass = inputClass), silent=TRUE)
+ checkException(.initCheck(iris, irisClass), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, randClass), silent=TRUE)
+ }
>
> # Test the main cfBuild function for the construction of the ensemble
> test.cfBuild <- function() {
+ checkEquals("cfBuild", class(ensObj)[2])
+ checkEquals(13, length(ensObj))
+ checkEquals(95.1, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals(92.16, ensObj$testAcc[1])
+ checkEquals(96.97, ensObj$trainAcc[1])
+ checkEquals(TRUE, any(attributes(ensObj)$names == "testAcc"))
+ checkEquals(100, getConfMatr(ensObj)[1,1])
+ checkEquals(94, getConfMatr(ensObj)[2,2])
+ checkEquals(91, getConfMatr(ensObj)[3,3])
+ }
>
> # Test the cfPermute function for permutation testing
> test.cfPermute <- function() {
+ checkEquals("cfPermute", class(permObj)[2])
+ checkEquals(4, length(permObj))
+ checkEquals(39.22, permObj$avgAcc[1])
+ checkEquals(2, length(permObj$permList))
+ }
>
> # Test the cfPredict function for use with unknown data
> test.cfPredict <- function() {
+ checkEquals("virginica", as.character(predRes[,1]))
+ checkEquals(100, predRes[,2])
+ }
>
> # Test the relevant stats functions
> test.stats <- function() {
+ checkException(getAcc(), silent=TRUE)
+ checkException(getAvgAcc(), silent=TRUE)
+ checkException(getOptParam(), silent=TRUE)
+ checkException(getConfMatr(), silent=TRUE)
+ checkException(getPerm5Num(), silent=TRUE)
+
+ checkException(getAcc(randClass), silent=TRUE)
+ checkException(getAvgAcc(randClass), silent=TRUE)
+ checkException(getOptParam(randClass), silent=TRUE)
+ checkException(getConfMatr(randClass), silent=TRUE)
+ checkException(getPerm5Num(randClass), silent=TRUE)
+
+ checkEquals(2, length(getAcc(ensObj)))
+ checkEquals(2, length(getAvgAcc(ensObj)))
+ checkEquals(92.16, getAcc(ensObj)$Test[1])
+ checkEquals(96.97, getAcc(ensObj)$Train[1])
+ checkEquals(95.10, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals("matrix", class(getOptParam(ensObj)))
+ checkEquals("table", class(getConfMatr(ensObj)))
+ checkEquals(9, length(getConfMatr(ensObj)))
+ checkEquals(5, length(getPerm5Num(permObj)))
+ checkEquals(33.33, getPerm5Num(permObj)$minimum)
+ }
>
> # Test the relevant plot functions
> test.plots <- function() {
+ checkException(ggEnsTrend(), silent=TRUE)
+ checkException(ggEnsHist(), silent=TRUE)
+ checkException(ggClassPred(), silent=TRUE)
+ checkException(ggPermHist(), silent=TRUE)
+
+ checkException(ggEnsTrend(permObj), silent=TRUE)
+ checkException(ggEnsHist(permObj), silent=TRUE)
+ checkException(ggClassPred(permObj), silent=TRUE)
+ checkException(ggPermHist(ensObj), silent=TRUE)
+ }
>
> # Execute all the tests
> test.initCheck()
[1] TRUE
> test.cfBuild()
Error in checkEquals(96.97, getAvgAcc(ensObj)$Train) :
Mean relative difference: 0.005156234
Calls: test.cfBuild -> checkEquals
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.1-2
Check: tests
Result: ERROR
Running ‘UnitTestingClassyfire.R’ [32s/36s]
Running the tests in ‘tests/UnitTestingClassyfire.R’ failed.
Complete output:
> # **************************************************************************************************************
> # Functions for unit testing
> # **************************************************************************************************************
>
> library('RUnit')
> library('classyfire')
Loading required package: snowfall
Loading required package: snow
Loading required package: e1071
Loading required package: boot
Loading required package: neldermead
Loading required package: optimbase
Loading required package: Matrix
Loading required package: optimsimplex
>
> set.seed(1)
>
> # Test data
> data(iris)
> irisClass <- iris[,5]
> irisData <- iris[,-5]
> randClass <- c(2, rep(3, length(irisClass)-1))
> testVec <- t(c(62,20,68,76))
>
> # Use parallel = FALSE for testing on CRAN!
> ensObj <- cfBuild(inputData = irisData, inputClass = irisClass, bootNum = 5, ensNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> permObj <- cfPermute(irisData, irisClass, bootNum = 5, ensNum = 2, permNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> predRes <- cfPredict(ensObj , testVec)
>
>
> # Test the initial checks on the input data provided by the user etc.
> test.initCheck <- function() {
+ checkException(.initCheck(), silent=TRUE)
+ checkException(.initCheck(irisData), silent=TRUE)
+ checkException(.initCheck(inputClass = inputClass), silent=TRUE)
+ checkException(.initCheck(iris, irisClass), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, randClass), silent=TRUE)
+ }
>
> # Test the main cfBuild function for the construction of the ensemble
> test.cfBuild <- function() {
+ checkEquals("cfBuild", class(ensObj)[2])
+ checkEquals(13, length(ensObj))
+ checkEquals(95.1, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals(92.16, ensObj$testAcc[1])
+ checkEquals(96.97, ensObj$trainAcc[1])
+ checkEquals(TRUE, any(attributes(ensObj)$names == "testAcc"))
+ checkEquals(100, getConfMatr(ensObj)[1,1])
+ checkEquals(94, getConfMatr(ensObj)[2,2])
+ checkEquals(91, getConfMatr(ensObj)[3,3])
+ }
>
> # Test the cfPermute function for permutation testing
> test.cfPermute <- function() {
+ checkEquals("cfPermute", class(permObj)[2])
+ checkEquals(4, length(permObj))
+ checkEquals(39.22, permObj$avgAcc[1])
+ checkEquals(2, length(permObj$permList))
+ }
>
> # Test the cfPredict function for use with unknown data
> test.cfPredict <- function() {
+ checkEquals("virginica", as.character(predRes[,1]))
+ checkEquals(100, predRes[,2])
+ }
>
> # Test the relevant stats functions
> test.stats <- function() {
+ checkException(getAcc(), silent=TRUE)
+ checkException(getAvgAcc(), silent=TRUE)
+ checkException(getOptParam(), silent=TRUE)
+ checkException(getConfMatr(), silent=TRUE)
+ checkException(getPerm5Num(), silent=TRUE)
+
+ checkException(getAcc(randClass), silent=TRUE)
+ checkException(getAvgAcc(randClass), silent=TRUE)
+ checkException(getOptParam(randClass), silent=TRUE)
+ checkException(getConfMatr(randClass), silent=TRUE)
+ checkException(getPerm5Num(randClass), silent=TRUE)
+
+ checkEquals(2, length(getAcc(ensObj)))
+ checkEquals(2, length(getAvgAcc(ensObj)))
+ checkEquals(92.16, getAcc(ensObj)$Test[1])
+ checkEquals(96.97, getAcc(ensObj)$Train[1])
+ checkEquals(95.10, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals("matrix", class(getOptParam(ensObj)))
+ checkEquals("table", class(getConfMatr(ensObj)))
+ checkEquals(9, length(getConfMatr(ensObj)))
+ checkEquals(5, length(getPerm5Num(permObj)))
+ checkEquals(33.33, getPerm5Num(permObj)$minimum)
+ }
>
> # Test the relevant plot functions
> test.plots <- function() {
+ checkException(ggEnsTrend(), silent=TRUE)
+ checkException(ggEnsHist(), silent=TRUE)
+ checkException(ggClassPred(), silent=TRUE)
+ checkException(ggPermHist(), silent=TRUE)
+
+ checkException(ggEnsTrend(permObj), silent=TRUE)
+ checkException(ggEnsHist(permObj), silent=TRUE)
+ checkException(ggClassPred(permObj), silent=TRUE)
+ checkException(ggPermHist(ensObj), silent=TRUE)
+ }
>
> # Execute all the tests
> test.initCheck()
[1] TRUE
> test.cfBuild()
Error in checkEquals(96.97, getAvgAcc(ensObj)$Train) :
Mean relative difference: 0.005156234
Calls: test.cfBuild -> checkEquals
Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang
Version: 0.1-2
Check: tests
Result: ERROR
Running ‘UnitTestingClassyfire.R’ [34s/37s]
Running the tests in ‘tests/UnitTestingClassyfire.R’ failed.
Complete output:
> # **************************************************************************************************************
> # Functions for unit testing
> # **************************************************************************************************************
>
> library('RUnit')
> library('classyfire')
Loading required package: snowfall
Loading required package: snow
Loading required package: e1071
Loading required package: boot
Loading required package: neldermead
Loading required package: optimbase
Loading required package: Matrix
Loading required package: optimsimplex
>
> set.seed(1)
>
> # Test data
> data(iris)
> irisClass <- iris[,5]
> irisData <- iris[,-5]
> randClass <- c(2, rep(3, length(irisClass)-1))
> testVec <- t(c(62,20,68,76))
>
> # Use parallel = FALSE for testing on CRAN!
> ensObj <- cfBuild(inputData = irisData, inputClass = irisClass, bootNum = 5, ensNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> permObj <- cfPermute(irisData, irisClass, bootNum = 5, ensNum = 2, permNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> predRes <- cfPredict(ensObj , testVec)
>
>
> # Test the initial checks on the input data provided by the user etc.
> test.initCheck <- function() {
+ checkException(.initCheck(), silent=TRUE)
+ checkException(.initCheck(irisData), silent=TRUE)
+ checkException(.initCheck(inputClass = inputClass), silent=TRUE)
+ checkException(.initCheck(iris, irisClass), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, randClass), silent=TRUE)
+ }
>
> # Test the main cfBuild function for the construction of the ensemble
> test.cfBuild <- function() {
+ checkEquals("cfBuild", class(ensObj)[2])
+ checkEquals(13, length(ensObj))
+ checkEquals(95.1, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals(92.16, ensObj$testAcc[1])
+ checkEquals(96.97, ensObj$trainAcc[1])
+ checkEquals(TRUE, any(attributes(ensObj)$names == "testAcc"))
+ checkEquals(100, getConfMatr(ensObj)[1,1])
+ checkEquals(94, getConfMatr(ensObj)[2,2])
+ checkEquals(91, getConfMatr(ensObj)[3,3])
+ }
>
> # Test the cfPermute function for permutation testing
> test.cfPermute <- function() {
+ checkEquals("cfPermute", class(permObj)[2])
+ checkEquals(4, length(permObj))
+ checkEquals(39.22, permObj$avgAcc[1])
+ checkEquals(2, length(permObj$permList))
+ }
>
> # Test the cfPredict function for use with unknown data
> test.cfPredict <- function() {
+ checkEquals("virginica", as.character(predRes[,1]))
+ checkEquals(100, predRes[,2])
+ }
>
> # Test the relevant stats functions
> test.stats <- function() {
+ checkException(getAcc(), silent=TRUE)
+ checkException(getAvgAcc(), silent=TRUE)
+ checkException(getOptParam(), silent=TRUE)
+ checkException(getConfMatr(), silent=TRUE)
+ checkException(getPerm5Num(), silent=TRUE)
+
+ checkException(getAcc(randClass), silent=TRUE)
+ checkException(getAvgAcc(randClass), silent=TRUE)
+ checkException(getOptParam(randClass), silent=TRUE)
+ checkException(getConfMatr(randClass), silent=TRUE)
+ checkException(getPerm5Num(randClass), silent=TRUE)
+
+ checkEquals(2, length(getAcc(ensObj)))
+ checkEquals(2, length(getAvgAcc(ensObj)))
+ checkEquals(92.16, getAcc(ensObj)$Test[1])
+ checkEquals(96.97, getAcc(ensObj)$Train[1])
+ checkEquals(95.10, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals("matrix", class(getOptParam(ensObj)))
+ checkEquals("table", class(getConfMatr(ensObj)))
+ checkEquals(9, length(getConfMatr(ensObj)))
+ checkEquals(5, length(getPerm5Num(permObj)))
+ checkEquals(33.33, getPerm5Num(permObj)$minimum)
+ }
>
> # Test the relevant plot functions
> test.plots <- function() {
+ checkException(ggEnsTrend(), silent=TRUE)
+ checkException(ggEnsHist(), silent=TRUE)
+ checkException(ggClassPred(), silent=TRUE)
+ checkException(ggPermHist(), silent=TRUE)
+
+ checkException(ggEnsTrend(permObj), silent=TRUE)
+ checkException(ggEnsHist(permObj), silent=TRUE)
+ checkException(ggClassPred(permObj), silent=TRUE)
+ checkException(ggPermHist(ensObj), silent=TRUE)
+ }
>
> # Execute all the tests
> test.initCheck()
[1] TRUE
> test.cfBuild()
Error in checkEquals(96.97, getAvgAcc(ensObj)$Train) :
Mean relative difference: 0.005156234
Calls: test.cfBuild -> checkEquals
Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc
Version: 0.1-2
Check: tests
Result: ERROR
Running 'UnitTestingClassyfire.R' [29s]
Running the tests in 'tests/UnitTestingClassyfire.R' failed.
Complete output:
> # **************************************************************************************************************
> # Functions for unit testing
> # **************************************************************************************************************
>
> library('RUnit')
> library('classyfire')
Loading required package: snowfall
Loading required package: snow
Loading required package: e1071
Loading required package: boot
Loading required package: neldermead
Loading required package: optimbase
Loading required package: Matrix
Loading required package: optimsimplex
>
> set.seed(1)
>
> # Test data
> data(iris)
> irisClass <- iris[,5]
> irisData <- iris[,-5]
> randClass <- c(2, rep(3, length(irisClass)-1))
> testVec <- t(c(62,20,68,76))
>
> # Use parallel = FALSE for testing on CRAN!
> ensObj <- cfBuild(inputData = irisData, inputClass = irisClass, bootNum = 5, ensNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> permObj <- cfPermute(irisData, irisClass, bootNum = 5, ensNum = 2, permNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> predRes <- cfPredict(ensObj , testVec)
>
>
> # Test the initial checks on the input data provided by the user etc.
> test.initCheck <- function() {
+ checkException(.initCheck(), silent=TRUE)
+ checkException(.initCheck(irisData), silent=TRUE)
+ checkException(.initCheck(inputClass = inputClass), silent=TRUE)
+ checkException(.initCheck(iris, irisClass), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, randClass), silent=TRUE)
+ }
>
> # Test the main cfBuild function for the construction of the ensemble
> test.cfBuild <- function() {
+ checkEquals("cfBuild", class(ensObj)[2])
+ checkEquals(13, length(ensObj))
+ checkEquals(95.1, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals(92.16, ensObj$testAcc[1])
+ checkEquals(96.97, ensObj$trainAcc[1])
+ checkEquals(TRUE, any(attributes(ensObj)$names == "testAcc"))
+ checkEquals(100, getConfMatr(ensObj)[1,1])
+ checkEquals(94, getConfMatr(ensObj)[2,2])
+ checkEquals(91, getConfMatr(ensObj)[3,3])
+ }
>
> # Test the cfPermute function for permutation testing
> test.cfPermute <- function() {
+ checkEquals("cfPermute", class(permObj)[2])
+ checkEquals(4, length(permObj))
+ checkEquals(39.22, permObj$avgAcc[1])
+ checkEquals(2, length(permObj$permList))
+ }
>
> # Test the cfPredict function for use with unknown data
> test.cfPredict <- function() {
+ checkEquals("virginica", as.character(predRes[,1]))
+ checkEquals(100, predRes[,2])
+ }
>
> # Test the relevant stats functions
> test.stats <- function() {
+ checkException(getAcc(), silent=TRUE)
+ checkException(getAvgAcc(), silent=TRUE)
+ checkException(getOptParam(), silent=TRUE)
+ checkException(getConfMatr(), silent=TRUE)
+ checkException(getPerm5Num(), silent=TRUE)
+
+ checkException(getAcc(randClass), silent=TRUE)
+ checkException(getAvgAcc(randClass), silent=TRUE)
+ checkException(getOptParam(randClass), silent=TRUE)
+ checkException(getConfMatr(randClass), silent=TRUE)
+ checkException(getPerm5Num(randClass), silent=TRUE)
+
+ checkEquals(2, length(getAcc(ensObj)))
+ checkEquals(2, length(getAvgAcc(ensObj)))
+ checkEquals(92.16, getAcc(ensObj)$Test[1])
+ checkEquals(96.97, getAcc(ensObj)$Train[1])
+ checkEquals(95.10, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals("matrix", class(getOptParam(ensObj)))
+ checkEquals("table", class(getConfMatr(ensObj)))
+ checkEquals(9, length(getConfMatr(ensObj)))
+ checkEquals(5, length(getPerm5Num(permObj)))
+ checkEquals(33.33, getPerm5Num(permObj)$minimum)
+ }
>
> # Test the relevant plot functions
> test.plots <- function() {
+ checkException(ggEnsTrend(), silent=TRUE)
+ checkException(ggEnsHist(), silent=TRUE)
+ checkException(ggClassPred(), silent=TRUE)
+ checkException(ggPermHist(), silent=TRUE)
+
+ checkException(ggEnsTrend(permObj), silent=TRUE)
+ checkException(ggEnsHist(permObj), silent=TRUE)
+ checkException(ggClassPred(permObj), silent=TRUE)
+ checkException(ggPermHist(ensObj), silent=TRUE)
+ }
>
> # Execute all the tests
> test.initCheck()
[1] TRUE
> test.cfBuild()
Error in checkEquals(96.97, getAvgAcc(ensObj)$Train) :
Mean relative difference: 0.005156234
Calls: test.cfBuild -> checkEquals
Execution halted
Flavor: r-devel-windows-ix86+x86_64
Version: 0.1-2
Check: tests
Result: ERROR
Running ‘UnitTestingClassyfire.R’ [52s/67s]
Running the tests in ‘tests/UnitTestingClassyfire.R’ failed.
Complete output:
> # **************************************************************************************************************
> # Functions for unit testing
> # **************************************************************************************************************
>
> library('RUnit')
> library('classyfire')
Loading required package: snowfall
Loading required package: snow
Loading required package: e1071
Loading required package: boot
Loading required package: neldermead
Loading required package: optimbase
Loading required package: Matrix
Loading required package: optimsimplex
>
> set.seed(1)
>
> # Test data
> data(iris)
> irisClass <- iris[,5]
> irisData <- iris[,-5]
> randClass <- c(2, rep(3, length(irisClass)-1))
> testVec <- t(c(62,20,68,76))
>
> # Use parallel = FALSE for testing on CRAN!
> ensObj <- cfBuild(inputData = irisData, inputClass = irisClass, bootNum = 5, ensNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> permObj <- cfPermute(irisData, irisClass, bootNum = 5, ensNum = 2, permNum = 2, parallel = FALSE)
snowfall 1.84-6.1 initialized: sequential execution, one CPU.
> predRes <- cfPredict(ensObj , testVec)
>
>
> # Test the initial checks on the input data provided by the user etc.
> test.initCheck <- function() {
+ checkException(.initCheck(), silent=TRUE)
+ checkException(.initCheck(irisData), silent=TRUE)
+ checkException(.initCheck(inputClass = inputClass), silent=TRUE)
+ checkException(.initCheck(iris, irisClass), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, irisData), silent=TRUE)
+ checkException(.initCheck(irisData, randClass), silent=TRUE)
+ }
>
> # Test the main cfBuild function for the construction of the ensemble
> test.cfBuild <- function() {
+ checkEquals("cfBuild", class(ensObj)[2])
+ checkEquals(13, length(ensObj))
+ checkEquals(95.1, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals(92.16, ensObj$testAcc[1])
+ checkEquals(96.97, ensObj$trainAcc[1])
+ checkEquals(TRUE, any(attributes(ensObj)$names == "testAcc"))
+ checkEquals(100, getConfMatr(ensObj)[1,1])
+ checkEquals(94, getConfMatr(ensObj)[2,2])
+ checkEquals(91, getConfMatr(ensObj)[3,3])
+ }
>
> # Test the cfPermute function for permutation testing
> test.cfPermute <- function() {
+ checkEquals("cfPermute", class(permObj)[2])
+ checkEquals(4, length(permObj))
+ checkEquals(39.22, permObj$avgAcc[1])
+ checkEquals(2, length(permObj$permList))
+ }
>
> # Test the cfPredict function for use with unknown data
> test.cfPredict <- function() {
+ checkEquals("virginica", as.character(predRes[,1]))
+ checkEquals(100, predRes[,2])
+ }
>
> # Test the relevant stats functions
> test.stats <- function() {
+ checkException(getAcc(), silent=TRUE)
+ checkException(getAvgAcc(), silent=TRUE)
+ checkException(getOptParam(), silent=TRUE)
+ checkException(getConfMatr(), silent=TRUE)
+ checkException(getPerm5Num(), silent=TRUE)
+
+ checkException(getAcc(randClass), silent=TRUE)
+ checkException(getAvgAcc(randClass), silent=TRUE)
+ checkException(getOptParam(randClass), silent=TRUE)
+ checkException(getConfMatr(randClass), silent=TRUE)
+ checkException(getPerm5Num(randClass), silent=TRUE)
+
+ checkEquals(2, length(getAcc(ensObj)))
+ checkEquals(2, length(getAvgAcc(ensObj)))
+ checkEquals(92.16, getAcc(ensObj)$Test[1])
+ checkEquals(96.97, getAcc(ensObj)$Train[1])
+ checkEquals(95.10, getAvgAcc(ensObj)$Test)
+ checkEquals(96.97, getAvgAcc(ensObj)$Train)
+ checkEquals("matrix", class(getOptParam(ensObj)))
+ checkEquals("table", class(getConfMatr(ensObj)))
+ checkEquals(9, length(getConfMatr(ensObj)))
+ checkEquals(5, length(getPerm5Num(permObj)))
+ checkEquals(33.33, getPerm5Num(permObj)$minimum)
+ }
>
> # Test the relevant plot functions
> test.plots <- function() {
+ checkException(ggEnsTrend(), silent=TRUE)
+ checkException(ggEnsHist(), silent=TRUE)
+ checkException(ggClassPred(), silent=TRUE)
+ checkException(ggPermHist(), silent=TRUE)
+
+ checkException(ggEnsTrend(permObj), silent=TRUE)
+ checkException(ggEnsHist(permObj), silent=TRUE)
+ checkException(ggClassPred(permObj), silent=TRUE)
+ checkException(ggPermHist(ensObj), silent=TRUE)
+ }
>
> # Execute all the tests
> test.initCheck()
[1] TRUE
> test.cfBuild()
Error in checkEquals(96.97, getAvgAcc(ensObj)$Train) :
Mean relative difference: 0.005156234
Calls: test.cfBuild -> checkEquals
Execution halted
Flavor: r-patched-solaris-x86