Data-mining-dm-dti

提供:Dev Guides
移動先:案内検索

データマイニング-デシジョンツリーの誘導

決定木は、ルートノード、ブランチ、およびリーフノードを含む構造です。 各内部ノードは属性のテストを示し、各ブランチはテストの結果を示し、各リーフノードはクラスラベルを保持します。 ツリーの最上位ノードはルートノードです。

次の決定ツリーは、企業の顧客がコンピューターを購入する可能性が高いかどうかを示す概念buy_computer用です。 各内部ノードは、属性のテストを表します。 各リーフノードはクラスを表します。

デシジョンツリー

決定木を持つことの利点は次のとおりです-

  • ドメインに関する知識は必要ありません。
  • 理解するのは簡単です。
  • 決定木の学習と分類の手順は簡単で高速です。

決定木誘導アルゴリズム

Jという名前の機械研究者 Ross Quinlanは1980年にID3(Iterative Dichotomiser)として知られる決定木アルゴリズムを開発しました。 その後、彼はID3の後継であるC4.5を発表しました。 ID3とC4.5は貪欲なアプローチを採用しています。 このアルゴリズムでは、バックトラックはありません。ツリーは、トップダウンの再帰的な分割統治方式で構築されます。

Generating a decision tree form training tuples of data partition D
Algorithm : Generate_decision_tree

Input:
Data partition, D, which is a set of training tuples
and their associated class labels.
attribute_list, the set of candidate attributes.
Attribute selection method, a procedure to determine the
splitting criterion that best partitions that the data
tuples into individual classes. This criterion includes a
splitting_attribute and either a splitting point or splitting subset.

Output:
 A Decision Tree

Method
create a node N;

if tuples in D are all of the same class, C then
   return N as leaf node labeled with class C;

if attribute_list is empty then
   return N as leaf node with labeled
   with majority class in D;|| majority voting

apply attribute_selection_method(D, attribute_list)
to find the best splitting_criterion;
label node N with splitting_criterion;

if splitting_attribute is discrete-valued and
   multiway splits allowed then //no restricted to binary trees

attribute_list = splitting attribute;//remove splitting attribute
for each outcome j of splitting criterion

  //partition the tuples and grow subtrees for each partition
   let Dj be the set of data tuples in D satisfying outcome j;//a partition

   if Dj is empty then
      attach a leaf labeled with the majority
      class in D to node N;
   else
      attach the node returned by Generate
      decision tree(Dj, attribute list) to node N;
   end for
return N;

木の剪定

ツリーの枝刈りは、ノイズまたは異常値によるトレーニングデータの異常を除去するために実行されます。 剪定された木は小さく、複雑ではありません。

ツリーの剪定アプローチ

木を剪定するには2つのアプローチがあります-

  • 事前剪定-ツリーは、その構築を早期に停止することにより剪定されます。
  • ポストプルーニング-このアプローチは、完全に成長したツリーからサブツリーを削除します。

コストの複雑さ

コストの複雑さは、次の2つのパラメータによって測定されます-

  • ツリーの葉の数、および
  • ツリーのエラー率。