0

トレーニング データとテスト データの vowpal_wabbit データ構造を理解しようとしていますが、理解できないようです。

私はいくつかのトレーニングデータを持っています。

機能 1: 0 機能 2: 1 機能 3: 10 機能 4: 5 クラス ラベル: A

機能 1: 0 機能 2: 2 機能 3: 30 機能 4: 8 クラス ラベル: C

機能 1: 2 機能 2: 10 機能 3: 9 機能 4: 7 クラス ラベル: B

このウェブサイトに基づいて、いくつかのトレーニング データの例を調べました。

http://hunch.net/~vw/validate.html

私の検証データ

1 | haha:1 hehe:2 hoho:3
1 | haha:2 hehe:2 hoho:3 
3 | haha:3 hehe:2 hoho:3 
1 | haha:4 hehe:2 hoho:3 
2 | haha:5 hehe:2 hoho:3  

ただし、それぞれ 4 つと 5 つの機能があると主張する理由がわかりません。

検証:

検証フィードバック

Total of 5 examples pasted.

(example #1) Example “1 | haha:1 hehe:2 hoho:3”.
(example #1) Found “[label] |…” prefix format.
(example #1) Example label / response / class is “1”.
(example #1) Example has default “1.0” importance weight.
(example #1) Example has default “0” base.
(example #1, namespace #1) Using default namespace.
(example #1, namespace #1) Found 3 feature(s).
(example #1, namespace #1, feature #1) Label “haha”.
(example #1, namespace #1, feature #1) Value “1”.
(example #1, namespace #1, feature #2) Label “hehe”.
(example #1, namespace #1, feature #2) Value “2”.
(example #1, namespace #1, feature #3) Label “hoho”.
(example #1, namespace #1, feature #3) Value “3”.

(example #2) Example “1 | haha:2 hehe:2 hoho:3 ”.
(example #2) Found “[label] |…” prefix format.
(example #2) Example label / response / class is “1”.
(example #2) Example has default “1.0” importance weight.
(example #2) Example has default “0” base.
(example #2, namespace #1) Using default namespace.
(example #2, namespace #1) Found 4 feature(s).
(example #2, namespace #1, feature #1) Label “haha”.
(example #2, namespace #1, feature #1) Value “2”.
(example #2, namespace #1, feature #2) Label “hehe”.
(example #2, namespace #1, feature #2) Value “2”.
(example #2, namespace #1, feature #3) Label “hoho”.
(example #2, namespace #1, feature #3) Value “3”.
(example #2, namespace #1, feature #4) Label “”.
(example #2, namespace #1, feature #4) Using default value of “1” for feature.

(example #3) Example “3 | haha:3 hehe:2 hoho:3 ”.
(example #3) Found “[label] |…” prefix format.
(example #3) Example label / response / class is “3”.
(example #3) Example has default “1.0” importance weight.
(example #3) Example has default “0” base.
(example #3, namespace #1) Using default namespace.
(example #3, namespace #1) Found 4 feature(s).
(example #3, namespace #1, feature #1) Label “haha”.
(example #3, namespace #1, feature #1) Value “3”.
(example #3, namespace #1, feature #2) Label “hehe”.
(example #3, namespace #1, feature #2) Value “2”.
(example #3, namespace #1, feature #3) Label “hoho”.
(example #3, namespace #1, feature #3) Value “3”.
(example #3, namespace #1, feature #4) Label “”.
(example #3, namespace #1, feature #4) Using default value of “1” for feature.

(example #4) Example “1 | haha:4 hehe:2 hoho:3 ”.
(example #4) Found “[label] |…” prefix format.
(example #4) Example label / response / class is “1”.
(example #4) Example has default “1.0” importance weight.
(example #4) Example has default “0” base.
(example #4, namespace #1) Using default namespace.
(example #4, namespace #1) Found 4 feature(s).
(example #4, namespace #1, feature #1) Label “haha”.
(example #4, namespace #1, feature #1) Value “4”.
(example #4, namespace #1, feature #2) Label “hehe”.
(example #4, namespace #1, feature #2) Value “2”.
(example #4, namespace #1, feature #3) Label “hoho”.
(example #4, namespace #1, feature #3) Value “3”.
(example #4, namespace #1, feature #4) Label “”.
(example #4, namespace #1, feature #4) Using default value of “1” for feature.

(example #5) Example “2 | haha:5 hehe:2 hoho:3 ”.
(example #5) Found “[label] |…” prefix format.
(example #5) Example label / response / class is “2”.
(example #5) Example has default “1.0” importance weight.
(example #5) Example has default “0” base.
(example #5, namespace #1) Using default namespace.
(example #5, namespace #1) Found 5 feature(s).
(example #5, namespace #1, feature #1) Label “haha”.
(example #5, namespace #1, feature #1) Value “5”.
(example #5, namespace #1, feature #2) Label “hehe”.
(example #5, namespace #1, feature #2) Value “2”.
(example #5, namespace #1, feature #3) Label “hoho”.
(example #5, namespace #1, feature #3) Value “3”.
(example #5, namespace #1, feature #4) Label “”.
(example #5, namespace #1, feature #4) Using default value of “1” for feature.
(example #5, namespace #1, feature #5) Label “”.
(example #5, namespace #1, feature #5) Using default value of “1” for feature.
4

1 に答える 1

2

それぞれ 4 つと 5 つの機能があると主張する理由

行末の余分なスペース記号は、http://hunch.net/~vw/validate.htmlによって余分な機能として解釈されます。(はい、サンプルの最後の行には 2 つの余分なスペースがあります。) validate.html が追加機能の空の名前を報告することに注意してください。

(example #4, namespace #1, feature #4) Label “”.

validate.htmlは JavaScript で実装されており、VW 自体 (C 言語) の実装とは完全に独立していることに注意してください。VW は末尾のスペースを無視します。次の方法でテストできます。

$ vw -P 1 < sample.data
...   
average    since         example     example  current  current  current
loss       last          counter      weight    label  predict features
1.000000   1.000000          1      1.0     1.0000   0.0000        4
0.522042   0.044084          2      2.0     1.0000   0.7900        4
1.838150   4.470366          3      3.0     3.0000   0.8857        4
1.488676   0.440255          4      4.0     1.0000   1.6635        4
1.270585   0.398217          5      5.0     2.0000   1.3690        4

したがって、5 つの例すべてに 4 つの機能があると報告されています (最後の列を参照)。なぜ4つ?自動的に追加される追加の定数 (インターセプト) 機能があります。したくない場合は、 を使用できますvw --noconstant

于 2015-03-05T19:13:42.633 に答える