Weka attribute date doesn't work

主宰稳场 提交于 2020-01-06 19:33:02

问题


I created a .arff file with the attribute date:

@attribute data date "yyyy-MM-dd"

And others attributes.

One example of data is:

@data

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

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.

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?


回答1:


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

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

Edit:

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.

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



来源:https://stackoverflow.com/questions/30903104/weka-attribute-date-doesnt-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!