Skip to content

Commit

Permalink
more issues from checks
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Jan 7, 2024
1 parent 66591b1 commit c2de386
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions R-package/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ importFrom(methods,new)
importFrom(stats,coef)
importFrom(stats,median)
importFrom(stats,predict)
importFrom(stats,sd)
importFrom(utils,head)
importFrom(utils,object.size)
importFrom(utils,str)
Expand Down
8 changes: 6 additions & 2 deletions R-package/R/callbacks.R
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ xgb.cb.evaluation.log <- function() {
if (!is.data.table(prev_cb_res)) {
prev_cb_res <- data.table::as.data.table(prev_cb_res)
}
prev_take <- prev_cb_res[iter < min(evaluation_log$iter)] # nolint
prev_take <- prev_cb_res[prev_cb_res$iter < min(evaluation_log$iter)]
if (nrow(prev_take)) {
evaluation_log <- rbind(prev_cb_res, evaluation_log)
}
Expand Down Expand Up @@ -1117,7 +1117,11 @@ xgb.gblinear.history <- function(model, class_index = NULL) {
stop("model must be an object of either xgb.Booster or xgb.cv.synchronous class")
is_cv <- inherits(model, "xgb.cv.synchronous")

coef_path <- getElement(attributes(model), "gblinear_history")
if (!is_cv) {
coef_path <- getElement(attributes(model), "gblinear_history")
} else {
coef_path <- getElement(model, "gblinear_history")
}
if (is.null(coef_path)) {
stop("model must be trained while using the xgb.cb.gblinear.history() callback")
}
Expand Down
1 change: 1 addition & 0 deletions R-package/R/xgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ NULL
#' @importFrom stats coef
#' @importFrom stats predict
#' @importFrom stats median
#' @importFrom stats sd
#' @importFrom utils head
#' @importFrom graphics barplot
#' @importFrom graphics lines
Expand Down

0 comments on commit c2de386

Please sign in to comment.