Lint fix on infix operators
This commit is contained in:
parent
d7fce99564
commit
8bae715994
@ -23,5 +23,5 @@ test_that("Code Lint", {
|
||||
trailing_blank_lines_linter=lintr::trailing_blank_lines_linter,
|
||||
trailing_whitespace_linter=lintr::trailing_whitespace_linter
|
||||
)
|
||||
# lintr::expect_lint_free(linters=my_linters) # uncomment this if you want to check code quality
|
||||
lintr::expect_lint_free(linters=my_linters) # uncomment this if you want to check code quality
|
||||
})
|
||||
|
||||
@ -4,10 +4,10 @@ require(xgboost)
|
||||
|
||||
test_that("poisson regression works", {
|
||||
data(mtcars)
|
||||
bst = xgboost(data=as.matrix(mtcars[,-11]),label=mtcars[,11],
|
||||
bst <- xgboost(data = as.matrix(mtcars[,-11]),label = mtcars[,11],
|
||||
objective = 'count:poisson', nrounds=5)
|
||||
expect_equal(class(bst), "xgb.Booster")
|
||||
pred = predict(bst,as.matrix(mtcars[,-11]))
|
||||
pred <- predict(bst,as.matrix(mtcars[, -11]))
|
||||
expect_equal(length(pred), 32)
|
||||
sqrt(mean((pred - mtcars[,11]) ^ 2))
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user