您似乎正在使用脱字符号包来执行训练。在这种情况下,插入符号包似乎没有将任何其他参数传递给catboost.train函数,因此它可能不支持GPU功能。从the code的插入符中可以看出,...参数没有传递给catboost.train函数。
#' Fit model based on input data
#'
#' @param x,y: the current data used to fit the model
#' @param wts: optional instance weights (not applicable for this particular model)
#' @param param: the current tuning parameter values
#' @param lev: the class levels of the outcome (or NULL in regression)
#' @param last: a logical for whether the current fit is the final fit
#' @param weights: weights
#' @param classProbs: a logical for whether class probabilities should be computed
#'
#' @noRd
catboost.caret$fit <- function(x,y,wts,param,lev,last,weights,classProbs,...) {
param <- c(param,list(...))
if (is.null(param$loss_function)) {
param$loss_function <- "RMSE"
if (is.factor(y)) {
param$loss_function <- "Logloss"
if (length(lev) > 2) {
param$loss_function <- "MultiClass"
}
y <- as.double(y) - 1
}
}
test_pool <- NULL
if (!is.null(param$test_pool)) {
test_pool <- param$test_pool
if (class(test_pool) != "catboost.Pool")
stop("Expected catboost.Pool,got: ",class(test_pool))
param <- within(param,rm(test_pool))
}
pool <- catboost.from_data_frame(x,weight = wts)
model <- catboost.train(pool,test_pool,param)
model$lev <- lev
return(model)
}
根据您对R和插入符号的熟练程度,您可以add your own model to caret,方法是基本上将模型复制到插入符号github位置,然后对其进行修改以接受GPU参数,该参数应按{{3 }}
本文链接:https://www.f2er.com/2546595.html