0

我正在使用下一个代码来训练具有一个节点(决策树桩)的分类树,使用 CutPoint 属性我能够获得谓词拆分的值,但是我怎样才能获得使用的谓词?(在本例中为特征 1 或特征 2)

x1 = 10 * rand(10, 1);
x2 = 10 * rand(10, 1);

x = [x1 x2];
y = randi(2, 10, 1);

t = ClassificationTree.fit(x, y, 'MinParent', 10, 'MergeLeaves', 'off');

view(t)

t.CutPoint(1,:)

输出

Decision tree for classification
1  if x1<3.60576 then node 2 elseif x1>=3.60576 then node 3 else 1
2  class = 1
3  class = 2


ans =

    3.6058

所以我能够获得价值 3.6058 但我需要一种方法来获得 x1 是使用的功能。

4

1 回答 1

1

我想你想要:

t.CutVar{1}

ans =
x1
于 2013-08-20T12:18:04.600 回答