Multiclass classification with xgboost classifier?

前端 未结 3 872
别跟我提以往
别跟我提以往 2021-02-14 17:55

I am trying out multi-class classification with xgboost and I\'ve built it using this code,

clf = xgb.XGBClassifier(max_depth=7, n_estimators=1000)

clf.fit(byte         


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-14 18:23

    By default,XGBClassifier or many Classifier uses objective as binary but what it does internally is classifying (one vs rest) i.e. if you have 3 classes it will give result as (0 vs 1&2).If you're dealing with more than 2 classes you should always use softmax.Softmax turns logits into probabilities which will sum to 1.On basis of this,it makes the prediction which classes has the highest probabilities.As you can see the complexity increase as Saurabh mentioned in his answer so it will take more time.

提交回复
热议问题