3

質問があります。私は実世界からインスタンスを分類する Java アプリを持っています。それを double[][] に格納しています。

Instance iExample = new Instance(4); 
iExample.setValue((Attribute)fvWekaAttributes.elementAt(0), 1.0);       
iExample.setValue((Attribute)fvWekaAttributes.elementAt(1), 0.5);       
iExample.setValue((Attribute)fvWekaAttributes.elementAt(2), "gray"); 
iExample.setValue((Attribute)fvWekaAttributes.elementAt(3), "positive"); 

これはインスタンスを作成するために与えられた例ですが、インスタンスを分類しているので、ラベル付け/予測したいクラスである最後の要素(3-ClassAtribute)が必要ですか? 何を入れますか?空の文字列?

iExample.setValue((Attribute)fvWekaAttributes.elementAt(3), "");   

インスタンスにラベルを付けて、たとえば分布を取得できるようにしたいと考えています。

前もって感謝します

JS

4

1 に答える 1

3

を使用して、属性の値をInstance未指定に設定できます。myInstance.setMissing(int attributeIndex)

于 2011-06-19T06:40:21.403 に答える