I'm rather new to R. I have found ways to run classification using trees with bagging (randomforest), and ways to run regression with boosting (gbm), but what I'm looking for is to do classification using boosting.
Supposedly, gbm is able to do this when the target variable consists of 0s and 1s and when you set Bernoulli as the function -- but no, the results that I get still point to regression being used.
Any help will be very appreciated.
答案 0 :(得分:2)
如果您在插入符号包中使用xgboost,则可能还必须同时更改objective = binary:logistic
和eval_metric =
以反映您的分类需求。
答案 1 :(得分:1)
如果将预测值转换为0和1,它将变为分类。例如,使用round()。即,使用0.5的阈值。但是,有更复杂的方法可以找到最佳阈值。