所以我想用WEKA的Java API来创建一个新的字符串属性...创造秧鸡的Java API
通过API的javadoc阅读字符串属性,看来,这样做的方法是使用此构造函数:
Attribute
public Attribute(java.lang.String attributeName,
FastVector attributeValues)
Constructor for nominal attributes and string attributes. If a null vector of attribute values is passed to the method, the attribute is assumed to be a string.
Parameters:
attributeName - the name for the attribute
attributeValues - a vector of strings denoting the attribute values. Null if the attribute is a string attribute.
,但我坚持为我要传递到attributeValues参数是什么......
当我把在空,Java的抱怨保护对象
当我把空,它的语法错误
当我把在new FastVector()
,就变成了标称属性是空的,而不是一个字符串属性...
当我创建一个新的对象:
FastVector fv = new FastVector();
fv.addElement(null);
再通入FV的说法,它返回空指针异常...
究竟应该将什么东西放到attributeValues参数中,以便它变成一个字符串属性?