LoginSignup
3
1

More than 3 years have passed since last update.

【Xgboost】softmaxとsoftprobの違い

Posted at

softmax vs softprob

基本的にsoftmaxsoftprobも多クラス分類に利用される。

  • softmaxは予測が最大確率となっている1クラスを出力する。
  • softprobは予測しようとしているそれぞれのクラスの確率値を出力する。

multi:softmax: set XGBoost to do multiclass classification using the softmax objective, you also need to set num_class(number of classes)
multi:softprob: same as softmax, but output a vector of ndata * nclass, which can be further reshaped to ndata * nclass matrix. The result contains predicted probability of each data point belonging to each class.

xgboostでの使用例

param = {'max_depth': 2, 'eta': 1, 'objective': 'multi:softmax', 'num_class': 3}
param = {'max_depth': 2, 'eta': 1, 'objective': 'multi:softprob', 'num_class': 3}

参考

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1