0

I'm starting with WEKA and want to achieve the following.

I have file with 2 attributes: user_id, user_age. I can successfully load data using WEKA API and get Instances object.

Now I want to calculate new attribute user_age_range - like (0-18) - 0, (19-25) - 1, etc.

Is there a way to calculate this attribute using WEKA Filters? Also I would like not to iterate manually through all instances, but to define method that operates on single Instance and use some filter (or other abstraction) that'll apply corresponding "transformation" to all instances.

Please advice - how I could achieve this.

Thanks in advance.

4

2 に答える 2

0

ドキュメントを調べたところ、目的を達成するために組み合わせて使用​​できるフィルターが 1 つまたは 2 つ見つかりました。

http://weka.sourceforge.net/doc.dev/weka/filters/unsupervised/attribute/Copy.html

コピーを使用して、変換するコピーを作成します。

http://weka.sourceforge.net/doc.dev/weka/filters/unsupervised/attribute/NumericTransform.html

数値変換は、クラスとメソッド オプションを受け取ります。年齢を必要な範囲にボックス化する独自のクラスを作成し、このクラスとメソッドをオプションとして提供できます。

お役に立てれば

于 2013-03-08T13:38:52.150 に答える