gpt4 book ai didi

在Weka中过滤所有具有高属性值的实例

转载 作者:行者123 更新时间:2023-11-30 09:23:17 26 4
gpt4 key购买 nike

我有一个单词及其频率的数据集。

我想过滤具有 1 个或多个属性值 > 200(例如)的所有实例。

我需要类似 RemoveWithValues 过滤器的东西,但我想将它用于所有属性,而不仅仅是一个属性。

我怎样才能做到这一点?

注意:我使用的是 Weka Explorer,我不是在编写代码。

最佳答案

RemoveWithValues() 过滤器可以按以下方式使用:

Instances data;
RemoveWithValues filter = new RemoveWithValues();

String[] options = new String[4];
options[0] = "-C"; // Choose attribute to be used for selection
options[1] = "1"; // 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] = "10"; //200. Say you want all those instances whose values for this attribute are less than 200
filter.setOptions(options);

filter.setInputFormat(data);
Instances newData = Filter.useFilter(data, filter);

所以,这是针对一个属性的。将其放入循环中,在每次迭代中更改选项[1](迭代到所有属性的索引)。在此循环中,您必须用 newData 替换 data。

关于在Weka中过滤所有具有高属性值的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26238534/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com