Here is my code:
xgb <- xgboost(data = as.matrix(df_all_combined),
label = as.matrix(target_train),
eta = 0.1,
max_depth = 15,
nround=100,
subsample = 0.5,
colsample_bytree = 0.5,
seed = 1,
eval_metric = "auc",
objective = "binary:logistic",
num_class = 12,
nthread = 3)
Getting the below Error:
Error in xgb.iter.update(bst$handle, dtrain, iteration - 1, obj) : [09:17:34] amalgamation/../src/objective/regression_obj.cc:90: Check failed: (preds.size()) == (info.labels.size()) labels are not correctly providedpreds.size=840756, label.size=70063
Could anyone help me out to solve this issue? Not able to figure out the issue.
XGBoost can be avoided in following scenarios: Noisy Data: In case of noisy data, boosting models may overfit. In such cases, Random Forest can provide better results than boosting models, as Random Forest models reduce variance. XGBoost, or Tree based algorithms in general, cannot extrapolate.
Basically with False (e.g. 0) it does not print anything. With any integer, it will print the evaluation score at that step. So for verbose=100 it will tell you the score every 100 iterations. Setting verbose=True is the same as setting it to 1. Thus it will print a lot!
max_depth: The maximum depth per tree. A deeper tree might increase the performance, but also the complexity and chances to overfit. The value must be an integer greater than 0. Default is 6.
Try remove num_class = 12 from your parameters.
The error says:
labels are not correctly provided preds.size=840756, label.size=70063
This means that number of rows in df_all_combined
does not correspond to the number of rows in target_train
So target_train
should be of the shape (840756,)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With