KNIME可以根据集合创建决策树吗?

时间:2018-01-09 13:28:07

标签: decision-tree knime

我有包含集合的数据(例如,这不是我的真实数据):

Name,    Type,     Colors
Pikachu, Electric, Red|Black|Yellow
Raichu,  Electric, Brown
Meowth,  Normal,   Yellow|Brown
Togepi,  Fairy,    Yellow|White|Blue|Red
Eevee,   Normal,   Brown

我的目标是获得一个根据类型和颜色确定名称的规则集。

我在最后一栏使用Cell Splitter。我还有域计算器为每列创建谨慎的值,因为我的一些列可能有超过60个值 总的来说,我的工作流程如下:

enter image description here

数据看起来不错:

Pikachu Electric    [Red, Black, Yellow]
Raichu  Electric    [Brown]
Meowth  Normal      [Yellow, Brown]
Togepi  Fairy       [Yellow, White, Blue, Red]
Eevee   Normal      [Brown]

我的问题是我无法让树使用颜色设置值。我当前的输出规则如下所示 - 请注意,颜色不会在任何地方使用:

$Type$ = "Electric" AND TRUE    Pikachu 2.0 1.0
$Type$ = "Normal" AND TRUE      Meowth  2.0 1.0
$Type$ = "Fairy" AND TRUE       Togepi  1.0 1.0

甚至可以将集合用作决策树和规则集的一部分吗?如果是这样,怎么样?

1 个答案:

答案 0 :(得分:2)

如果您在UngroupCell Splitter节点之间添加Domain Calculator节点,那么我认为您可以获得所需内容。使用它,并重新创建工作流程,我得到以下规则集:

$Colors_SplitResultList$ = "Red" AND $Type$ = "Electric" => "Pikachu"
$Colors_SplitResultList$ = "Black" AND $Type$ = "Electric" => "Pikachu"
$Colors_SplitResultList$ = "Yellow" AND $Type$ = "Electric" => "Pikachu"
$Colors_SplitResultList$ = "Brown" AND $Type$ = "Electric" => "Raichu"
$Type$ = "Normal" AND TRUE => "Meowth"
$Type$ = "Fairy" AND TRUE => "Togepi"