Vowpal Wabbit:关于交互特征权重的问题

Vowpal Wabbit: question on weight of interaction features

在 VW 中,功能命名空间的格式如下所示:

Label [Tag]|Namespace Features |Namespace Features ... |Namespace Features Where:

Namespace=String[:Value]

例如:

1 1.0 |MetricFeatures:3.28 height:1.5 length:2.0 |Says black with white stripes |OtherFeatures NumberOfLegs:4.0 HasStripes

请注意 |MetricFeatures 命名空间的权重高于 1 (3.28)。基于上面的示例,如果我创建一些特征交互,比如在 M 和 S 命名空间之间使用 -q MS,作为两个原始特征命名空间的叉积的新特征命名空间是否具有 1 的重要性权重默认?或者它会继承两个重要性值的乘积(在本例中为 1*3.28 = 3.28)?

有没有办法手动修改特征交互的权重?例如。假设 MetricFeatures 的重要性权重为 1,我可以让 MetricFeaturesX 的二次交互生成的特征具有 x 的重要性权重吗?

目前无法对交互进行单独加权。


命名空间权重在解析时处理,因此在读取该命名空间的特征时,它们会乘以权重。

这可以通过使用--audit来验证:

Num weight bits = 18
learning rate = 0.5
initial_t = 0
power_t = 0.5
using no cache
Reading datafile = data.txt
num sources = 1
average  since         example        example  current  current  current
loss     last          counter         weight    label  predict features
0
    MetricFeatures^height:146807:4.92:0@0   MetricFeatures^length:38580:6.56:0@0    Says^black:100768:1:0@0 Says^with:163314:1:0@0  Says^white:106708:1:0@0Says^stripes:112832:1:0@0    OtherFeatures^NumberOfLegs:146847:4:0@0 OtherFeatures^HasStripes:229154:1:0@0   Constant:116060:1:0@0
1.000000 1.000000            1            1.0   1.0000   0.0000        9

finished run
number of examples = 1
weighted example sum = 1.000000
weighted label sum = 1.000000
average loss = 1.000000
best constant = 1.000000
best constant's loss = 0.000000
total feature number = 9

MetricFeatures^height:146807:4.92:0@0 -> 3.28 * 1.5 = 4.92