Creating a string attribute in Weka Java API

陌路散爱 提交于 2019-11-28 13:43:52

You have to cast the null to FastVector. Otherwise more methods would apply to the method signature:

    FastVector attributes = new FastVector();
    attributes.addElement(new Attribute("attr", (FastVector) null));

Here is a good resource for creating Instances on the fly: http://weka.wikispaces.com/Creating+an+ARFF+file

Easy way to build STRING Attribute in WEKA is this:

 new Attribute("Distribution_weight",(FastVector) null);

Main problem is WEKA's definition of NULL value, or NULL vector in new type of Java editors with imported weka.jar and throw exceptions mode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!