[R] enforce lintr checks (fixes #8012) (#8613)

This commit is contained in:
James Lamb
2022-12-24 15:02:56 -06:00
committed by GitHub
parent f489d824ca
commit c7e82b5914
11 changed files with 13 additions and 15 deletions

View File

@@ -13,7 +13,7 @@ y <- as.integer(y) - 1 # xgboost take features in [0,numOfClass)
x <- rbind(train[, -ncol(train)], test)
x <- as.matrix(x)
x <- matrix(as.numeric(x), nrow(x), ncol(x))
trind <- 1:length(y)
trind <- seq_along(y)
teind <- (nrow(train) + 1):nrow(x)
# Set necessary parameter
@@ -43,6 +43,6 @@ pred <- t(pred)
# Output submission
pred <- format(pred, digits = 2, scientific = FALSE) # shrink the size of submission
pred <- data.frame(1:nrow(pred), pred)
pred <- data.frame(seq_len(nrow(pred)), pred)
names(pred) <- c('id', paste0('Class_', 1:9))
write.csv(pred, file = 'submission.csv', quote = FALSE, row.names = FALSE)