Weka属性日期无效 [英] Weka attribute date doesn't work

查看:90
本文介绍了Weka属性日期无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个.arff文件,其属性日期为:

I created a .arff file with the attribute date:

@attribute data date yyyy-MM-dd

和其他属性。

数据的一个示例是:

@data

2014-01-02,11.27,11.44,11.03,11.18,11.07,11.07,11.12,9419, 2003400,2240946600,1

"2014-01-02",11.27,11.44,11.03,11.18,11.07,11.07,11.12,9419,2003400,2240946600,1

但是,Weka似乎无法识别日期属性。这是因为当我查看图形(从date属性)时,x轴(对应于日期)的边距开始于1388628000000,结束于1419904800000,这根本没有意义。

Yet, the Weka seems to not recognized the date attribute. That's because when I look at the graphic (from date attribute), the margin of the axis x (which would correspond the date) starts at 1388628000000 and ends at 1419904800000, which makes no sense at all.

当我尝试分类时,分类器(我使用J48树和SVM进行测试)仅采用一类并尊重整个测试集。显然这是错误的,我相信是因为date属性。

And when I tried to classify, the classifier (I test with J48 tree and SVM) only takes one class and esteem to the whole test set. Clearly is something wrong and I believe it's because the date attribute.

对如何解决这个问题有任何想法吗?

Any ideias to how can I solve this?

推荐答案

通过经过一些研究,我独立发现了一些与您的问题有关的东西。看看是否有帮助。

Through some research, I have independently found something that relates to your problem. Have a look and see if it's helpful for you.

https://stackoverflow.com/questions/32738822/weka-doesnt-differentiate-between-date-and-numeric-attributes-features

最严重的问题是某些Weka算法(超出期望)根本不接受日期属性。

Most serious issue is that some Weka algorithms (more than desirable) don't admit date attributes at all.

编辑:

比较日期类型和数字类型的两个属性时,Weka不会区分它们,也就是说,日期属性将其类型返回为因此,当它们不应该是正确答案时,它们具有重合类型。如果您检查日期属性,出于某些目的,它是从Weka视作日期,但在内部,Weka会将日期视为一个数字(如果我是对的,则为参考日期的毫秒数)。问题是,从用户的角度来看,它不是同一类型的属性,应该指出。

When comparing two attributes of type date vs numeric, Weka doesn't differentiate between them, that is, the date attribute is returning its type as numeric, therefore, they have coincident types when that should not be the correct answer. If you check date attribute, it is view from Weka as date for some purposes, but internally, Weka treats dates as a number (number of milisecond from reference date, if I'm right). The problem is that from the user's perspective, it is not the same type of attribute and it should be pointed.

我一直在考虑将日期转换为数字(可能通过

I have been thinking of converting date to numeric (possible through filters), but the inherent informative power of dates would be meaningless.

另一种方法涉及将date属性转换为几个数字和名义属性,例如:year,month ,每天,每年的一周,一周的一天。

Another approach relates to transforming the date attribute to several numeric+nominal attributes, such as: year, month, day, week-of-year, day-of-week.

这篇关于Weka属性日期无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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