如何在词袋中组合多个特征集
How to combine multiple feature sets in bag of words
我有根据类别 'descriptions' 和 'components' 进行预测的文本分类数据。我可以使用 python 中的词袋和 'descriptions' 中的 scikit 进行分类。但是我想使用词袋中的两个类别对各个特征集进行加权来获得预测
x = 描述 + 2* 组件
我该如何进行?
您可以针对描述和商家训练单独的分类器,并使用 score = w1 * predictions + w2 * components.
获得最终分数
w1
和 w2
的值应使用交叉验证获得。
或者,您可以通过组合训练数据集来训练单个多类分类器。
您现在将有 4 个类:
- 既不'predictions'也不'components'
- 'predictions' 但不是 'components'
- 不是'predictions'而是'components'
- 'predictions' 和 'components'
然后你就可以照常训练了。
我有根据类别 'descriptions' 和 'components' 进行预测的文本分类数据。我可以使用 python 中的词袋和 'descriptions' 中的 scikit 进行分类。但是我想使用词袋中的两个类别对各个特征集进行加权来获得预测 x = 描述 + 2* 组件 我该如何进行?
您可以针对描述和商家训练单独的分类器,并使用 score = w1 * predictions + w2 * components.
w1
和 w2
的值应使用交叉验证获得。
或者,您可以通过组合训练数据集来训练单个多类分类器。
您现在将有 4 个类:
- 既不'predictions'也不'components'
- 'predictions' 但不是 'components'
- 不是'predictions'而是'components'
- 'predictions' 和 'components'
然后你就可以照常训练了。