zachmayer / caretEnsemble

caret models all the way down :turtle:
Other
226 stars 75 forks source link

Indexing, as.caretList functions, na.action prediction pass-through #213

Closed washcycle closed 7 years ago

washcycle commented 7 years ago

This should close: Issue #104

Replaces Pull #211 and #212

I'd say these aren't robust as they could be, but I think they are still extremely useful in their current form.

lintr-bot commented 7 years ago

tests/testthat/test-caretStack.R:123:3: style: Words within variable and function names should be separated by '_' rather than '.'.

​  X.reg.na <- X.reg
  ^~~~~~~~

tests/testthat/test-caretStack.R:125:3: style: Words within variable and function names should be separated by '_' rather than '.'.

​  X.reg.na[sample(1:nrow(X.reg.na), 20), sample(1:ncol(X.reg.na)-1, 1)] <- NA
  ^~~~~~~~

tests/testthat/test-caretStack.R:125:26: style: Words within variable and function names should be separated by '_' rather than '.'.

​  X.reg.na[sample(1:nrow(X.reg.na), 20), sample(1:ncol(X.reg.na)-1, 1)] <- NA
                         ^~~~~~~~

tests/testthat/test-caretStack.R:125:56: style: Words within variable and function names should be separated by '_' rather than '.'.

​  X.reg.na[sample(1:nrow(X.reg.na), 20), sample(1:ncol(X.reg.na)-1, 1)] <- NA
                                                       ^~~~~~~~

tests/testthat/test-caretStack.R:127:57: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_warning(pred.reg <- predict(ens.reg, newdata = X.reg.na, na.action = na.pass))
                                                        ^~~~~~~~

tests/testthat/test-caretStack.R:128:32: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_length(pred.reg, nrow(X.reg.na))
                               ^~~~~~~~

tests/testthat/test-caretStack.R:130:57: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_warning(pred.reg <- predict(ens.reg, newdata = X.reg.na))
                                                        ^~~~~~~~

tests/testthat/test-caretStack.R:131:42: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_false(length(pred.reg) !=  nrow(X.reg.na))
                                         ^~~~~~~~
zachmayer commented 7 years ago

Looks good. You need to delint, and I think you need to add roxygen2 tags for the s3 methods (as and [).

And then I had a comment on the test. Thanks!

zachmayer commented 7 years ago

Actually a few other comments, but in general 👍

lintr-bot commented 7 years ago

tests/testthat/test-caretStack.R:127:57: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_warning(pred.reg <- predict(ens.reg, newdata = X.reg.na, na.action = na.pass))
                                                        ^~~~~~~~

tests/testthat/test-caretStack.R:128:32: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_length(pred.reg, nrow(X.reg.na))
                               ^~~~~~~~

tests/testthat/test-caretStack.R:130:57: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_warning(pred.reg <- predict(ens.reg, newdata = X.reg.na))
                                                        ^~~~~~~~

tests/testthat/test-caretStack.R:131:42: style: Words within variable and function names should be separated by '_' rather than '.'.

​  expect_false(length(pred.reg) !=  nrow(X.reg.na))
                                         ^~~~~~~~
coveralls commented 7 years ago

Coverage Status

Coverage increased (+32.3%) to 96.7% when pulling 3eeaa891790e719c48851350b769b84bc11eef45 on washcycle:master into 27a45556876774946bd82e21d19a01a84aba35f6 on zachmayer:master.

washcycle commented 7 years ago

I think this one is ready. I got all turned around with how the documentation was being generated.