catboost uncertainty

catboost uncertaintyの仕組みとチートシート

タグ catboost uncertainty 不確実性 分散


概要

  • catboostは決定木でありながら、不確実性を計算することができる
  • 技術的にはVirtual ensembleとうことをやっている
    • 一つのモデルの内部で決定木の乱択をやっているようである
  • 回帰でも使用でき、RMSEWithUncertaintyという損失関数になっている

RMSEWithUncertaintyのスニペット

model = CatBoostRegressor(iterations=1000, learning_rate=0.2, loss_function='RMSEWithUncertainty',
                          verbose=False, random_seed=0)

model.fit(train_pool, eval_set=val_pool)
print("best iteration =", model.get_best_iteration())
preds = model.predict(test)

mean_preds = preds[:, 0] #the first prediction is the estimated mean value
var_preds = preds[:, 1] #the second prediction is the estimated variance

Google Colab


参考