【发布时间】:2020-05-20 17:31:33
【问题描述】:
在查看LightGBM docs 时,我发现predict 支持pred_leaf 参数。文档说
pred_leaf (bool, optional (default=False)) – Whether to predict
leaf index.
但是,当做一个
data := (1, 28)
gbm := num_boost_round = X
embedding = gbm.predict(data, pred_leaf=True)
embedding.shape # [1, X]
print(embedding[0, :]) # [29, 2, 8, 26, 2, 2, 16, 18, 25, 30, 16, 25, 0, 17, 15]
我不明白为什么它输出的是一个填充的数组,而不是一个单热向量或标量值?它说它预测叶子索引?这可以用作另一个模型的“嵌入”吗?
Ps:我会在stats-stackexchange 中发布此内容,但看起来这是 1)特定于 lightgbm 和 2)他们没有 lightgbm 标签
【问题讨论】: