我在训练模型时发现,vw 日志中显示的特征数量非常大(远超过我的特征数量)。
我尝试使用一个小例子来重现这个问题:
simple.test:
-1 | 1 2 31 | 3 4 5
然后执行 “vw simple.test” 命令时,它显示使用了 8 个特征。其中一个特征是常数特征,但其他特征是什么?在我的实际例子中,我的特征与 vw 使用的特征之间的差异大约是十倍。
….
Num weight bits = 18learning rate = 0.5initial_t = 0power_t = 0.5using no cacheReading datafile = tnum sources = 1average since example example current current currentloss last counter weight label predict featuresfinished runnumber of examples = 2weighted example sum = 2weighted label sum = 3average loss = 1.9179best constant = 1.5total feature number = 8 !!!!
回答:
total feature number
显示的是所有观察到的例子的特征计数总和。因此,在你的例子中是 2*(3+1 常数)=8。当前例子的特征数量显示在 current features
列中。请注意,默认情况下只有 2^Nth
个例子会在屏幕上显示。一般来说,不同的观察可能具有不等的特征数量。