Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Error in UseMethod("xgboost") : no applicable method for 'xgboost' applied to an object of class "list"

$
0
0

I use a dataset that shows companies's default with a binary variable. using xgboost I have this problem.

 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

I'm pretty sure the code worked first. Thanks!


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>