如何删除属性值高于阈值的所有实例? [英] How to remove all instances that have an attribute with a value above a threshold?

查看:25
本文介绍了如何删除属性值高于阈值的所有实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们有以下数据集:

Let's say we have the following dataset:

X1: {4,7,0,1}
X2: {4,3,2,1}
X3: {6,6,6,6}

我想删除任何具有值为 > 的属性的实例;5,在这个例子中X1和X3应该被删除.我有 500 多个属性,我尝试使用:

I'd like to remove any instance that has an attribute with value > 5, in this example X1 and X3 should be removed. I have more than 500 attributes, and I've tried to use:

SubsetByExpression -E "(ATT1 < 6) or ... or (ATT500 < 6)"

它确实过滤了大部分实例,但仍有一些实例的值大于 5(我不确定为什么它删除了一些并保留了其他).

which did filter most of the instances, but there are still some instances that have values greater than 5 (I'm not really sure why it removed some and retained others).

在 WEKA 中是否有其他更合适的过滤器可供使用或任何其他方式来完成此任务?

Is there another more appropriate filter to use or any other way to achieve this task from within WEKA?

更新:

这是一个具体的例子.ARFF 文件的内容:

Here's a concrete example. The ARFF file's content:

@relation Test

@attribute word_1 NUMERIC
@attribute word_2 NUMERIC
@attribute word_3 NUMERIC
@attribute word_4 NUMERIC

@data
4,7,0,1
4,3,2,1
6,6,6,6
0,5,1,4

我想删除属性值为 6 或更多的所有实例,因此应删除第 1 行和第 3 行.如果我使用这个过滤器:

I'd like to remove all instances that have an attribute with a value of 6 or more, so the 1st and 3rd rows should be removed. If I use this filter:

SubsetByExpression -E "(ATT1 < 6) or (ATT2 < 6) or (ATT3 < 6) or (ATT4 < 6)"

只删除了一个实例,这是第三个,但第一个实例仍然存在.

Only one instance is removed, which is the the 3rd, but the 1st instance is still there.

我使用的版本是:3.6.2

The version I'm using is: 3.6.2

推荐答案

如果您将表达式更改为:

If you change your expression to:

SubsetByExpression -E "(ATT1<6) and (ATT2<6) and (ATT3<6) and (ATT4<6)",你得到了想要的结果.

SubsetByExpression -E "(ATT1< 6) and (ATT2< 6) and (ATT3< 6) and (ATT4< 6)", you get the desired result.

我相信您当前的说法是,只要一个属性值小于 6,您就应该保留实例.这个新声明说所有属性值应该小于 6

I believe your current statement says that you should keep the instance as long as one attribute value is less than six. This new statement says all attribute values should be less than six

这篇关于如何删除属性值高于阈值的所有实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆