-1
我有一個用值過濾去除不選擇特定的情況下,例如選擇情況下,我的Java代碼:如何在weka java API中使用SubsetByExpression過濾器?
RemoveWithValues filter = new RemoveWithValues();
String[] options = new String[4];
options[0] = "-C"; // Choose attribute to be used for selection
options[1] = "7"; // Attribute number
options[2] = "-S"; // Numeric value to be used for selection on numeric attribute. Instances with values smaller than given value will be selected. (default 0)
options[3] = "17908";
//200. Say you want all those instances whose values for this attribute are less than 200
//get customer id
try {
DataSource source = new DataSource("data/customer_data.csv");
Instances data = source.getDataSet();
filter.setOptions(options);
filter.setInputFormat(data);
filter.setDontFilterAfterFirstBatch(false);
Instances newData = RemoveWithValues.useFilter(data, filter);
System.out.println("new data");
System.out.println(newData);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
但這代碼不帶屬性選擇實例17908. 7個價值觀如何使用SubsetByExpression類改爲?
在此先感謝