I have a multiclass-classification dataset with the target (dependent) variable highly imbalanced. While using the randomForest package in R, I usually use the parameters sampsize & strata to account for the imbalance in training data. Are there any similar options in xgboost package also?

Summary of the number of datapoints available in each class.

Factor 1 : 667
Factor 2 : 676
Factor 3 :7807
Factor 4 : 850


1 Answer 1


In R, it's an option of the cross validation function : xgb.cv See the documentation here : https://www.rdocumentation.org/packages/xgboost/versions/0.4-4/topics/xgb.cv


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.