在WEKA数据集中定义工作日和周末?

时间:2016-07-12 12:51:28

标签: weka

这是我数据集的一小部分:

@relation
@attribute ID {'1','2','3','4','5'}
@attribute is_Weekend {Saturday, Sunday}
@attribute Weekday {Monday, Tuesday, Wednesday, Thursday, Friday}
@attribute Leaving_Time {'07:00<=x<09:00','09:00<=x<12:30'}

@data
'1',??,,'09:00<=x<12:30'
'2',??,'09:00<=x<12:30'
'3',??,'07:00<=x<09:00'
'4',??,'09:00<=x<12:30'
'5',??,'09:00<=x<12:30'

如何在数据部分定义工作日和周末!?

1 个答案:

答案 0 :(得分:0)

我不太确定你要做什么,因为你的属性定义有点令人困惑。 is_Weekend yesno的值不应该@data '1',?,'Monday','09:00<=x<12:30' '2',?,'Thursday','09:00<=x<12:30' '3','Saturday',?,'07:00<=x<09:00' '4',?,'Monday','09:00<=x<12:30' '5','Sunday',?,'09:00<=x<12:30' 吗?因为现在,每个数据点都需要周末和工作日。

假设它们是您想要的,您可以设置不适合丢失的属性:

@relation
@attribute ID {'1','2','3','4','5'}
@attribute is_Weekend {yes, no}
@attribute Weekday {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}
@attribute Leaving_Time {'07:00<=x<09:00','09:00<=x<12:30'}

@data
'1','no','Monday','09:00<=x<12:30'
'2','no','Thursday','09:00<=x<12:30'
'3','yes','Saturday','07:00<=x<09:00'
'4','no','Monday','09:00<=x<12:30'
'5','yes','Sunday','09:00<=x<12:30'

我宁愿这样做:

{{1}}