我使用一个数据集,显示公司的默认值与二进制变量。使用xgboost我有这个问题。
param <- list(objective = "binary:logistic",
+ eval_metric = "Aucklands",
+ max_depth = 7,
+ eta = 0.1,
+ gammma = 1,
+ colsample_bytree = 0.5,
+ min_child_weight = 1)
> set.seed(1234)
> train.label <- as.numeric(train.label)-1
> test.label<- as.numeric(test.label)-1
> # Pass in our hyperparameteres and train the model
> system.time(xgb <- xgboost(params = param,
+ data = dtrain,
+ label = train.label,
+ nrounds = 70,
+ print_every_n = 5,
+ verbose = 1))
Error in UseMethod("xgboost") :
no applicable method for 'xgboost' applied to an object of class "list"
Timing stopped at: 0.001 0 0.001
我很确定密码先起作用了。谢谢!
1条答案
按热度按时间jhiyze9q1#
尝试在xgb变量中使用xgboost::xgboost,我遇到了同样的问题,它对我很有效。