JP3810575B2 - Association rule extraction apparatus and recording medium - Google Patents
Association rule extraction apparatus and recording medium Download PDFInfo
- Publication number
- JP3810575B2 JP3810575B2 JP05737599A JP5737599A JP3810575B2 JP 3810575 B2 JP3810575 B2 JP 3810575B2 JP 05737599 A JP05737599 A JP 05737599A JP 5737599 A JP5737599 A JP 5737599A JP 3810575 B2 JP3810575 B2 JP 3810575B2
- Authority
- JP
- Japan
- Prior art keywords
- item set
- rule
- hash tree
- item
- items
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Complex Calculations (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、データベースに記録された複数のレコードから、そのデータベースの品目セット間の相関ルールを抽出するための相関ルール抽出装置、相関ルール抽出方法および記録媒体に関するものである。
【0002】
【従来の技術】
図18は従来の相関ルール抽出装置の構成例を示すブロック図である。この従来の相関ルール抽出装置では、例えば「Fast Algorithms for Mining Association Rules」(Agrawalら著、Proc. of the 20th VLDB Conference, Santiago, Chile、1994年)や特開平8−287106号公報に記載のアプリオリ(Apriori)法に基づいて、データベースに記録された複数のレコードから、そのデータベースの品目セット間の相関ルールが抽出される。アプリオリ法では、すべてのレコードのうち品目セット「A,B,・・・,X,Y」の含まれるレコードの割合を支持度とし、ルール「A,B,・・・,X→Y」の条件部の品目セット「A,B,・・・,X」の含まれるレコードのうち帰結部の品目「Y」の含まれるレコードの割合を確信度として、これらの支持度および確信度がそれぞれ所定の基準値より高い場合に、ルール「A,B,・・・,X→Y」が相関ルールとして抽出される。
【0003】
図18において、1は所定の対象についてのデータを、複数のレコードとして保持するデータベースである。5は生成された相関ルールを保持する相関ルール集合ファイルである。102はデータベース1のレコードを参照して、品目数がkの大品目セットから品目数が(k+1)の大品目セットを生成する大品目セット生成手段である。なお、大品目セットとは、所定の基準値より高い支持度を有する品目セットをいう。104は各大品目セットからルール(すなわち相関ルールの候補)を生成し、そのルールの確信度に基づいて相関ルールを抽出する仮説生成検証手段である。
【0004】
大品目セット生成手段102において、121はデータベース1のレコードを参照して、候補品目セット生成手段122により生成された候補品目セットの支持度を計算し、所定の基準値より高い支持度を有する候補品目セットを大品目セットとする候補品目セット検証手段であり、122は(k−2)個の品目が同一であり、かつ品目数が(k−1)である複数の大品目セットのうちの各々2つの大品目セットから、(k−2)個の同一の品目、およびその大品目セットにおけるそれぞれ異なる2個の品目で構成される品目数がkである候補品目セットを生成する候補品目セット生成手段である。
【0005】
仮説生成検証手段104において、31は品目数がkである大品目セットから、(k−1)個の品目の条件部と1個の品目の帰結部で構成されるすべてのルールを生成するルール候補生成手段であり、33はルール候補生成手段31により生成されたルールの確信度を、大品目セットを参照して計算する確信度計算手段である。
【0006】
次に動作について説明する。
まず、候補品目セット検証手段121は、品目数が1である大品目セットを、データベース1の各レコードの品目を参照して生成する。候補品目セット生成手段122は、品目数が1である複数の大品目セットのうちの各々2つの大品目セットから、およびその大品目セットにおけるそれぞれ異なる2個の品目で構成される品目数が2である候補品目セットを生成する。
【0007】
次に、候補品目セット検証手段121は、データベース1のレコードを参照して、候補品目セット生成手段122により生成された候補品目セットの支持度を計算し、所定の基準値より高い支持度を有する候補品目セットを大品目セットとする。
【0008】
そして、候補品目セット生成手段122は、(k−2)個の品目が共通し、かつ品目数が(k−1)である複数の大品目セットのうちの各々2つの大品目セットから、(k−2)個の共通の品目、およびその大品目セットにおけるそれぞれ異なる2個の品目で構成される品目数がkである候補品目セットを生成する。以下同様に、大品目セット生成手段102は、候補品目セットがなくなるまで品目数を1ずつ増加させながら、大品目セットを生成していく。
【0009】
一方、仮説生成検証手段104においては、ルール候補生成手段31が、候補品目セット検証手段121による品目数がkである大品目セットから、(k−1)個の品目の条件部と1個の品目の帰結部で構成されるすべてのルールを生成する。そして、確信度計算手段33が、大品目セットを参照して、ルール候補生成手段31により生成されたルールの確信度を計算し、所定の基準値より高い確信度を有するルールを相関ルールとして相関ルール集合ファイル5に保存する。
【0010】
このようにして、各品目数についての大品目セットが生成され、その大品目セットに基づいて相関ルールが抽出される。
【0011】
なお、大品目セットを保持する場合、データ構造をハッシュ木としてメモリなどに保持することが多い。図19は大品目セットを示すハッシュ木の一例を示す図である。このハッシュ木においては、各品目がノードを構成し、1つの品目セットが、ルート(root)から下位の所定のノードまでの1つの枝を構成する。例えば図19において、ルートからノード1およびノード3を経てノード5までの枝は、品目1,3,5により構成される品目セット[1,3,5]により構成されている。なお、以下、品目x1,x2,・・・,xnにより構成される品目セットを[x1,x2,・・・,xn]と表記する。
【0012】
すなわち、上述の大品目セットの生成の繰り返しにより、大品目セットが増加する毎にハッシュ木に枝が追加されていき、品目数が増加する毎に枝を構成するノードを増加して枝伸ばしをしていく。ハッシュ木において、すべての枝はいずれかの大品目セットを構成する。
【0013】
このようにして木構造で複数の品目数の異なる大品目セットを表現することができるのは、大品目セットにおける部分集合は、必ず大品目セットになるという性質を利用したものである。なお、大品目セットにおける部分集合とは、大品目セットを構成するk個の品目のうちの(k−1)個以下の品目で構成される品目セットのことである。
【0014】
このように、ハッシュ木として複数の大品目セットを保持することにより、大品目セットを単に順次記憶していく場合に比較して、大品目セットの保持に必要な記憶容量を低減させている。
【0015】
しかしながら、ハッシュ木を利用しても品目数が多い場合には、ハッシュ木自体が大きくなってしまい、大品目セットを生成するために、多くの記憶容量を有するメモリが必要になる。また、メモリの記憶容量が小さく仮想記憶方式を採用している場合には、ページングが頻繁に発生し、処理に要する時間が長くなってしまうなどの課題があった。
【0016】
上述のものの他の従来の技術としては、特開平8−161287号公報、特開平8−263346号公報、特開平8−272825号公報、特開平8−314981号公報、特開平9−34721号公報、特開平10−269248号公報にそれぞれ記載のものなどがある。
【0017】
そこで、本出願人は、このような課題を解決するために、ページングを抑制するための手法を特願平10−182416号において先に提案した。図20は先に提案した第1の手法について説明する図であり、図21は先に提案した第2の手法について説明する図である。
【0018】
先に提案した第1の手法においては、大品目セットがファイルに格納され、そのファイルから1つずつ大品目セットが読み出されてハッシュ木に追加され、さらにその追加された大品目セットおよび既に追加されている大品目セットから生成されるすべての候補品目セットがハッシュ木に追加される。
【0019】
ここで、大品目セットに対応して候補品目セットを生成する際には、その大品目セットの最後の品目より大きな番号の品目のノードを、大品目セットの下位にそれぞれ並行して追加して候補品目セットの枝が生成される。例えば、1から10までの10種類の品目が存在し、大品目セット[1,3,5]に対応して候補品目セットを生成する場合、大品目セット[1,3,5]の枝の下位に、ノード6,7,8,9,10がそれぞれ追加され、候補品目セット[1,3,5,6],[1,3,5,7],[1,3,5,8],[1,3,5,9],[1,3,5,10]が生成される。
【0020】
上述の一連の処理が品目数の同一な大品目セットのそれぞれについて順番に実行されていく。そして、この一連の処理毎に、ハッシュ木により占有されている記憶容量が計算され、その値が所定の基準値を超えた場合に、ハッシュ木に追加された候補品目セットについてレコードとのマッチングにより支持度が計算され、ファイルに保存された大品目セットより品目数が1だけ大きい大品目セットが図20に示すように生成され、すべての大品目セットが生成された後に一括して更新される。従ってファイルには同一の品目数の大品目セットが常に保存されていることになる。なお、大品目セットとならなかった候補品目セットは削除される。
【0021】
そして、ルールの検証のために必要な品目セット(ルール検証用品目セット)、すなわち大品目セットより1だけ品目数が少ない、その大品目セットの部分集合である品目セットもハッシュ木に追加される。これらの部分木に基づいて相関ルールを生成した後、追加された大品目セットおよびそれに関して追加された部分木が削除される。そして、次の大品目セットが同様にして追加され同様に処理される。
【0022】
先に提案した第2の手法においては、アプリオリ法と同様の枝伸ばしが実行される。この手法においては、ハッシュ木のために予め割り当てられた記憶容量の数分の1である所定の記憶容量に、ハッシュ木のデータ量が達するまで、最後の品目以外の品目がすべて同一である大品目セットが一括してファイルから読み出されてハッシュ木に順次追加される。ここで、予め割り当てられた記憶容量の数分の1である所定の記憶容量分だけ大品目セットを読み込むのは、その後に、候補品目セットやルール検証用品目セットの追加に必要な記憶容量を残しておくためである。
【0023】
そして、最後の品目以外の品目がすべて同一である大品目セットから候補品目セットが生成される。例えば大品目セット[2,3,5],[2,3,7]がファイルに保存されている場合、図21に示すように、これらの大品目セット[2,3,5],[2,3,7]は一括して読み出され、ハッシュ木に追加される。そして、互いの異なる最後の品目「5」,「7」に基づいて、大品目セット[2,3,5]に品目「7」を追加して候補品目セット「2,3,5,7」が追加される。
【0024】
以上のように、先に提案した第1および第2の手法によれば、予め割り当てられた記憶容量の範囲内で効率良く大品目セットの生成ができ、ひいては相関ルールを効率良く抽出することができる。
【0025】
【発明が解決しようとする課題】
先に提案した手法は以上のように構成されており、上記の課題を解決することはできるものの第1の手法においては候補品目セットの生成の際にアプリオリ法と同様の枝伸ばしとは異なり多くの枝を生成するため、支持度を計算する候補品目セットの数が多くなり、処理時間がその分だけ長くなるという課題があった。また、第2の手法においては、予め割り当てられた記憶容量の数分の1に、大品目セットのデータ量が達した場合に、残りの記憶容量を使用して、それらの大品目セットについての候補品目セットなどをハッシュ木に追加するようにしているため、予め割り当てられた記憶容量がすべて有効に使用されない可能性があるという課題があった。
【0026】
また、上述の従来の技術においては、表形式のデータから相関ルールを抽出する場合、前処理として、表における各属性値に番号1,2,3などを割り当て、属性値をその番号(品目)に変換した後に、上述の処理を実行するようにしているため、自明な、同じ属性における属性値の相関ルール(例えば属性「性別」における属性値「男」,「女」に対する「性別が『男』であるならば性別は『女』ではない」といういわゆる負の相関を有するルール)も抽出され、後処理として、そのような自明な相関ルールを除去する必要があるという課題があった。
【0027】
さらに、上述の従来の技術においては、帰結部の品目数が1である相関ルールのみが抽出されているため、帰結部の品目数が2以上である相関ルールを抽出することが困難であるという課題があった。
【0028】
この発明は上記のような課題を解決するためになされたもので、大品目セットを、最後の品目以外の品目が共通するもの毎に読み出し、ハッシュ木に大品目セットの共通部分である品目セットを追加し、その大品目セットの最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ共通部分に追加して候補品目セットを生成するとともに、ルール検証用品目セットを生成してハッシュ木に追加した後にハッシュ木のための記憶容量を計算し、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットおよび各ルール検証用品目セットの支持度を計算し、候補品目セットのうち、支持度が所定の基準値より大きいものを大品目セットとして保存し、ルール検証用品目セットおよび大品目セットの支持度より計算される確信度またはχ2乗値に基づいて大品目セットから相関ルールを生成し、その後にハッシュ木を消去するようにして、予め割り当てられた記憶容量を有効に使用するようにする相関ルール抽出装置、相関ルール抽出方法および記録媒体を得ることを目的とする。
【0029】
また、各品目を、属性番号と属性値で構成される2次元インデックスとしてデータベースに保存し、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成するようにして、同じ属性における属性値の相関ルールの生成を抑制するための相関ルール抽出装置、相関ルール抽出方法および記録媒体を得ることを目的とする。
【0030】
さらに、品目数がkである大品目セットから相関ルールの候補を作成する際に、条件部の品目数が1〜(k−1)であり、帰結部の品目数が(k−1)〜1であるルールをそれぞれ生成するようにして、帰結部が2以上の相関ルールを生成するための相関ルール抽出装置、相関ルール抽出方法および記録媒体を得ることを目的とする。
【0031】
【課題を解決するための手段】
この発明に係る相関ルール抽出装置は、ハッシュ木として複数の品目セットを記憶する記憶手段と、大品目セットを保存する保存手段と、保存手段から大品目セットを、最後の品目以外の品目が共通するもの毎に読み出し、その共通部分である品目セットをハッシュ木に追加する共通品目セット追加手段と、読み出された大品目セットの最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ共通部分に追加して候補品目セットを生成する候補品目セット生成手段と、各候補品目セットの一部であってその候補品目セットより品目数が1だけ少ない品目セットをルール検証用品目セットとしてハッシュ木に追加するルール検証用品目セット生成手段と、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加後のハッシュ木のための記憶容量を計算する記憶容量計算手段と、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットおよび各ルール検証用品目セットの支持度を計算し、候補品目セットのうち、支持度が所定の基準値より大きいものを大品目セットとして保存手段に保存する支持度計算手段と、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、ルール検証用品目セットおよび大品目セットの支持度より計算される確信度またはχ2乗値に基づいて大品目セットから相関ルールを生成し、その後にハッシュ木を記憶手段から消去する相関ルール生成手段とを備えるものである。
【0032】
この発明に係る相関ルール抽出装置は、大品目セットとともにその支持度を保存手段に保存し、各ルール検証用品目セットと同一の大品目セットが保存手段に保存されている場合には、その大品目セットの支持度をそのルール検証用品目セットの支持度とするようにしたものである。
【0033】
この発明に係る相関ルール抽出装置は、データベースからレコードを読み出し、候補品目セットの出現数およびルール検証用品目セットの出現数を並行してカウントして候補品目セットの支持度およびルール検証用品目セットの支持度を計算するようにしたものである。
【0034】
この発明に係る相関ルール抽出装置は、ハッシュ木からルール検証用品目セットに対応する部分木を切り離した後、各候補品目セットの支持度を計算し、支持度の計算後、ルール検証用品目セットに対応する部分木をハッシュ木の元の位置に戻すようにしたものである。
【0035】
この発明に係る相関ルール抽出装置は、切り離した部分木が接続されていたハッシュ木の接続ノードとその部分木のルートとの対応関係を示すデータをスタックによるデータ構造に従って記憶し、そのデータに基づいて、切り離した部分木をハッシュ木の元の位置に戻すようにしたものである。
【0036】
この発明に係る相関ルール抽出装置は、切り離した部分木が接続されていたハッシュ木の接続ノードとその部分木のルートとの対応関係を示すデータをリストによるデータ構造に従って記憶し、そのデータに基づいて、切り離した部分木をハッシュ木の元の位置に戻すようにしたものである。
【0037】
この発明に係る相関ルール抽出装置は、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、直前に追加された大品目セットの共通部分、候補品目セットおよびルール検証用品目セットをハッシュ木から削除するようにしたものである。
【0038】
この発明に係る相関ルール抽出装置は、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量のうちの最大値が、所定の基準値とハッシュ木のための記憶容量との差より大きくなった場合に、支持度を計算し、相関ルールを生成し、その後にハッシュ木を消去するようにしたものである。
【0039】
この発明に係る相関ルール抽出装置は、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量の平均値が、所定の基準値とハッシュ木のための記憶容量との差より大きくなった場合に、支持度を計算し、相関ルールを生成し、その後にハッシュ木を消去するようにしたものである。
【0041】
この発明に係る記録媒体は、コンピュータに、所定の保存手段から大品目セットを、最後の品目以外の品目が共通するもの毎に読み出し、所定の記憶手段に記憶されたハッシュ木に、その大品目セットの共通部分である品目セットを追加する手順、読み出した大品目セットの最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ共通部分に追加して候補品目セットを生成する手順、各候補品目セットの一部であって候補品目セットより品目数が1だけ少ない品目セットをルール検証用品目セットとしてハッシュ木に追加する手順、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加後のハッシュ木のための記憶容量を計算する手順、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットおよび各ルール検証用品目セットの支持度を計算し、候補品目セットのうち、支持度が所定の基準値より大きいものを大品目セットとして所定の保存手段に保存する手順、ルール検証用品目セットおよび大品目セットの支持度より計算される確信度またはχ2乗値に基づいて大品目セットから相関ルールを生成し、その後にハッシュ木を所定の記憶手段から消去する手順を実行させるためのプログラムを記録したものである。
【0042】
この発明に係る相関ルール抽出装置は、属性番号と属性値で構成される2次元インデックスとして各品目を保存するデータベースと、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出する相関ルール抽出部とを備えるものである。
【0043】
この発明に係る相関ルール抽出装置は、データベースに、各品目の値を、属性番号と属性値で構成される2次元インデックスとして、または、そのデータベースの複数の属性で構成される属性グループについての属性グループ番号とそれらのうちのいずれかの属性値で構成される2次元インデックスとして保存し、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号または属性グループ番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出するようにしたものである。
【0044】
この発明に係る相関ルール抽出装置は、所定の表形式でデータベースに予め保存されたレコードの各属性値を2次元インデックスに変換し、その2次元インデックスをデータベースに保存するデータ変換手段を備えるものである。
【0046】
この発明に係る記録媒体は、コンピュータに、属性番号と属性値で構成される2次元インデックスとして各品目を保存するデータベースから品目を読み出す手順、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出する手順を実行させるためのプログラムを記録したものである。
【0047】
この発明に係る相関ルール抽出装置は、大品目セットを保存する保存手段と、保存手段に保存された大品目セットのうち、最後の品目以外の品目が共通する大品目セットから候補品目セットを生成する候補品目セット生成手段と、候補品目セットの支持度を計算し、その支持度に基づいて候補品目セットと同一品目数の大品目セットを生成して保存手段に保存する支持度計算手段と、大品目セットの品目数をkとして、大品目セットを、品目数が1から(k−1)までの条件部と品目数が(k−1)から1までの帰結部とに分割してそれぞれ生成されるルールのうち、確信度またはχ2乗値が所定の基準値より大きいものを相関ルールとする相関ルール生成手段とを備えるものである。
【0048】
この発明に係る相関ルール抽出装置は、大品目セットを保存手段に保存する際に、その大品目セットの支持度も保存し、ルールの条件部と同一の大品目セットが保存手段に保存されている場合には、その大品目セットの支持度をそのルールの条件部の支持度としてルールの確信度またはχ2乗値を計算するようにしたものである。
【0050】
この発明に係る記録媒体は、コンピュータに、所定の保存手段に保存された大品目セットのうち、最後の品目以外の品目が共通する大品目セットから、その大品目セットより品目数が1だけ多い候補品目セットを生成する手順、候補品目セットの支持度を計算し、その支持度に基づいて候補品目セットと同一品目数の大品目セットを生成して所定の保存手段に保存する手順、大品目セットの品目数をkとして、大品目セットを、品目数が1から(k−1)までの条件部と品目数が(k−1)から1までの帰結部とに分割してそれぞれ生成されるルールのうち、確信度またはχ2乗値が所定の基準値より大きいものを相関ルールとする手順を実行させるためのプログラムを記録したものである。
【0051】
【発明の実施の形態】
以下、この発明の実施の一形態を説明する。
実施の形態1.
図1はこの発明の実施の形態1による相関ルール抽出装置の構成を示すブロック図である。図において、1は所定の対象についてのデータを、複数のレコードとして保持するデータベースである。2はメモリ6にハッシュ木として大品目セットを記憶させ、そのハッシュ木を操作して、品目数がkの大品目セットから品目数が(k+1)の大品目セットを生成し、大品目セットファイル(保存手段)3に保存する大品目セット生成手段である。4は各大品目セットからルール(すなわち相関ルールの候補)を生成し、そのルールの確信度またはχ2乗値に基づいて相関ルールを抽出する仮説生成検証手段(相関ルール生成手段)である。5は生成された相関ルールを保持する相関ルール集合ファイルである。6は大品目セット、候補品目セットおよびルール検証用品目セットをハッシュ木として記憶するメモリ(記憶手段)である。なお、ハッシュ木を構成する品目はルートに近い程、その番号が低くなるように配置される。
【0052】
なお、以下、品目数がkである大品目セットをL(k)と、品目数がkである候補品目セットをC(k)と、品目数がkであるルール検証用品目セットをLL(k)と表記する。
【0053】
大品目セット生成手段2において、21はデータベース1のレコードを参照して、候補品目セット生成手段22により生成された候補品目セットC(k)の支持度を計算し、所定の基準値(最小支持度)より高い支持度を有する候補品目セットC(k)を大品目セットL(k)とする候補品目セット検証手段(支持度計算手段)である。
【0054】
22は最後の品目以外が共通な大品目セットL(k−1)のうちの各々2つの大品目セットL(k−1)から、それらの共通部分(第1品目〜第(k−2)品目)、および、残り2個の最後の品目(各大品目セットの第(k−1)品目)で構成される候補品目セットC(k)を生成し、メモリ6のハッシュ木に追加する候補品目セット生成手段(候補品目セット生成手段、ルール検証用品目セット生成手段)である。
【0055】
23は最後の品目以外が共通な大品目セットL(k)を大品目セットファイル3から読み出し、その共通部分である品目数(k−1)の品目セットをハッシュ木に追加するとともに、メモリ6にハッシュ木として記憶されている品目セット(大品目セット、候補品目セットなど)の占有する記憶容量を調べるハッシュ木操作手段(共通品目セット追加手段、記憶容量計算手段)である。
【0056】
仮説生成検証手段4において、31は大品目セットL(k)から、(k−1)個の品目の条件部と1個の品目の帰結部で構成されるすべてのルールを生成するルール候補生成手段であり、32はルール候補生成手段31により生成されたルールの確信度またはχ2乗値を計算する検証値計算手段である。
【0057】
なお、χ2乗値はχ2乗検定のためのもので、ここでは、ルールの条件部と帰結部との関連する度合を示すものとして次式で計算される。
【数1】
ここでnはデータベース1におけるレコードの総数であり、Aはルールの条件部の支持度であり、Bはルールの帰結部の支持度であり、Cはルール全体の支持度である。
【0058】
次に動作について説明する。
図2は実施の形態1による相関ルール抽出装置の動作について説明するフローチャートである。図3は大品目セットファイル3の内容の一例を示す図であり、図4は、図3の大品目セット[1,2,3],[1,2,4],[1,3,5],[1,4,5]で構成されるハッシュ木を示す図である。図5は、図2のステップST3における動作の一例について説明する図であり、図6は、図2のステップST4における動作の一例について説明する図であり、図7は、図2のステップST5における動作の一例について説明する図である。
【0059】
まず図2のステップST1において、大品目セット生成手段2の候補品目セット検証手段21がデータベース1のレコードに出現する各品目の支持度を計算し、所定の基準値より高い支持度を有する品目を大品目セットL(1)として大品目セットファイル3に、その支持度とともに保存する。
【0060】
次に、品目数の指標kの初期値を2として(ステップST2)、以下、大品目セットL(k−1)から大品目セットL(k)を生成する処理、および生成した大品目セットL(k)から相関ルールを生成する処理について説明する。
【0061】
最初にステップST3において、ハッシュ木操作手段23が大品目セットファイル3から大品目セットL(k−1)を、最後の品目以外の品目が共通する大品目セット毎に一括して読み込み、その共通部分である品目セットをハッシュ木に追加し、各大品目セットL(k−1)の最後の品目を、その共通部分に関連づけてハッシュ木とは別にメモリ6に記憶させる。
【0062】
例えば大品目セットL(3)について(すなわちk=4である場合)、図3に示す大品目セットファイル3の[1,2,3],[1,2,4],[1,3,5],[1,4,5]についてステップST3〜ステップST5の処理が終了した状態のハッシュ木は図4に示すようになるが、この次、ステップST3においてこの大品目セットファイル3から大品目セット[2,4,5],[2,4,6],[2,4,7]が一括して読み込まれる。そして、図4に示すハッシュ木に、それらの共通部分である品目セット[2,4]で構成される枝が追加される。なお、このとき、読み込まれた各大品目セットの残りの品目「5」,「6」,「7」が例えば1つの配列としてハッシュ木とは別にメモリ6に記憶され、図5に示すように、ポインタなどによる、その配列と共通部分の枝との対応関係も合わせて記憶される。
【0063】
次にステップST4において、候補品目セット生成手段22は、大品目セットL(k−1)の最後の品目の集合の各品目について、その品目と、その集合内でその品目より番号の大きい各品目により、上述の共通部分の枝をそれぞれ伸ばし、候補品目セットC(k)を生成する。
【0064】
例えば大品目セットL(3)を読み込んだ後、図5に示す状態になった場合では、まず、配列「5,6,7」のうちの品目5が読み出され、図6に示すように、その品目「5」およびその品目より番号の大きい品目「6」,「7」により、共通部分「2,4」の下位に「5,6」,「5,7」が追加され、候補品目セット[2,4,5,6],[2,4,5,7]が生成される。なお、候補品目セット[2,4,5,6],[2,4,5,7]について「2,4,5」は共通しているので、このときのハッシュ木は図6に示すように「2,4,5」から「6」と「7」が派生する形態になっている。
【0065】
そして候補品目セットC(k)の生成が終了すると、ステップST5において仮説生成検証手段4のルール候補生成手段31が、生成された候補品目セットC(k)の一部であって品目数が1だけ少ない品目セットをルール検証用品目セットLL(k−1)としてハッシュ木に追加する。なお、ルール検証用品目セットLL(k−1)に対応する枝が既に存在している場合には、そのルール検証用品目セットLL(k−1)については特に何も追加しない。
【0066】
ここでルール検証用品目セットLL(k−1)は、候補品目セットC(k)が大品目セットL(k)になった場合に生成される候補ルールの条件部に対応するものである。例えば図6に示すように候補品目セットC(4)が[2,4,5,6],[2,4,5,7]の2つである場合には、ルール検証用品目セットLL(3)は、[2,4,5],[2,4,6],[2,5,6],[4,5,6],[2,4,7],[2,5,7],[4,5,7]の7つになる。なお、[2,4,5]は重複している。すなわち候補品目セット[2,4,5,6]が大品目セットになった場合には、ルール「2,4,5→6」,「2,4,6→5」,「2,5,6→4」,「4,5,6→2」が生成され、候補品目セット[2,4,5,7]が大品目セットになった場合には、ルール「2,4,5→7」,「2,4,7→5」,「2,5,7→4」,「4,5,7→2」が生成されるため、その条件部であるルール検証用品目セットが予め生成される。
【0067】
そして、図6に示すハッシュ木に、これらのルール検証用品目セットLL(3)のうち、ハッシュ木に存在しない枝「2,4,6」,「2,5,6」,「4,5,6」,「2,4,7」,「2,5,7」,「4,5,7」が図7に示すように追加される。
【0068】
以上のステップST3〜ステップST5の処理が終了した時点でステップST6において、ハッシュ木操作手段23は、メモリ6においてハッシュ木が占有する記憶容量を調べ、その記憶容量が所定の基準値より大きいか否かを判断する。そして、ハッシュ木が占有する記憶容量が所定の基準値以下である場合には、ハッシュ木操作手段23は、候補品目セット生成手段22に、ステップST3で読み込んだすべての大品目セットL(k−1)の最後の品目について候補品目セットC(k)の生成が終了しているか否かを問い合わせる。
【0069】
そして、すべての大品目セットL(k−1)の最後の品目について候補品目セットC(k)の生成が終了していない場合には、ステップST4に戻り、次の、大品目セットL(k−1)の最後の品目についての処理が同様に実行される。例えば、図7に示すハッシュ木が占有する記憶容量が所定の基準値以下である場合には、次にステップST4において、配列「5,6,7」のうちの品目「6」について候補品目セットC(k)の生成およびルール検証用品目セットLL(k−1)の生成が実行される。
【0070】
一方、すべての大品目セットL(k−1)の最後の品目について候補品目セットC(k)の生成が終了している場合、ハッシュ木操作手段23は、ステップST8において、すべての大品目セットL(k−1)が読み込まれて処理されたか否かを判断する。そして、すべての大品目セットL(k−1)が処理されていないと判断された場合には、ステップST3に戻り、次の一群の大品目セットL(k−1)が読み込まれ、同様の処理が実行される。一方、すべての大品目セットL(k−1)が処理されたと判断された場合、ステップST9に進み、大品目セットL(k)の生成などが実行される。
【0071】
また、ステップST6においてハッシュ木が占有する記憶容量が所定の基準値より高い場合には、ステップST9に進み、その時点までにメモリ6のハッシュ木に追加された各候補品目セットC(k)の支持度が候補品目セット検証手段21によりデータベース1のレコードを参照して計算され、候補品目セットC(k)のうち、所定の基準値より高い支持度を有する候補品目セットC(k)が大品目セットL(k)とされ、その大品目セットL(k)はその支持度とともに大品目セットファイル3に保存される。なお、大品目セットファイル3において、大品目セットがその品目数毎に保存される。すなわち、生成された大品目セットL(k)は大品目セットL(k−1)とは別に保存される。
【0072】
そして大品目セットL(k)が生成されると、次にステップST10において、ハッシュ木操作手段23が、その時点までにメモリ6のハッシュ木に追加された各ルール検証用品目セットLL(k−1)と同一の大品目セットL(k−1)を大品目セットファイル3で検索し、該当する大品目セットL(k−1)を発見した場合には、その大品目セットL(k−1)の支持度を読み出し、そのルール検証用品目セットLL(k−1)の支持度として、そのルール検証用品目セットLL(k−1)に関連づけてメモリ6に記憶させる。該当する大品目セットL(k−1)が発見されなかった場合、特に何もしない。そのルール検証用品目セットLL(k−1)を包含する品目セットの支持度は所定の基準値以下であり、そのような品目セットは大品目セットL(k)にならず、そのルール検証用品目セットLL(k−1)の支持度は特に必要ないからである。
【0073】
次に、ステップST11において、まずルール候補生成手段31は、大品目セットL(k)のうちの各(k−1)の品目を条件部とし、残りの1品目を帰結部としたルールを生成する。そして、検証値計算手段32は、各ルールについて、条件部の支持度(すなわちルール検証用品目セットLL(k−1)の支持度)および大品目セットL(k)の支持度から確信度を計算するか、あるいは、条件部の支持度、帰結部の支持度、大品目セットL(k)の支持度およびデータベースのレコード数からχ2乗値を計算し、所定の基準値より確信度またはχ2乗値が高いルールを相関ルールとして相関ルール集合ファイル5に保存する。
【0074】
このように相関ルールを生成し保存した後、ステップST12において、仮説生成検証手段4は、メモリ6のハッシュ木を消去して、ハッシュ木に占有された記憶領域を解放する。
【0075】
そしてステップST13において、ハッシュ木操作手段23は、大品目セットファイル3における大品目セットL(k−1)をすべて読み込み、かつ、読み込んだ大品目セットL(k−1)からすべての候補品目セットC(k)が生成されているか否かを判断する。読み込んだ大品目セットL(k−1)からすべての候補品目セットC(k)が生成されていない場合には、ステップST7を介してステップST4に戻り、残りの候補品目セットC(k)の生成が実行され、読み込んだ大品目セットL(k−1)からすべての候補品目セットC(k)が生成されているが、読み込んでいない大品目セットL(k−1)がある場合には、ステップST7およびステップST8を介してステップST3に戻り、残りの大品目セットL(k−1)が読み込まれる。
【0076】
一方、大品目セットファイル3における大品目セットL(k−1)をすべて読み込み、かつ、読み込んだ大品目セットL(k−1)からすべての候補品目セットC(k)が生成されていると判断された場合には、ステップST14に進み、ハッシュ木操作手段23は、大品目セットL(k)が少なくとも1つは生成されたか否かを判断する。大品目セットL(k)が少なくとも1つは生成されている場合には、品目数の指標kの値を1だけ増加して(ステップST15)、ステップST3に戻り、品目数kが1だけ多い大品目セットL(k+1)の生成が実行される。一方、大品目セットL(k)が1つも生成されなかった場合には、処理を終了する。
【0077】
以上のように、この実施の形態1によれば、大品目セットL(k−1)を最後の品目以外の品目が共通するもの毎に読み出し、ハッシュ木に大品目セットL(k−1)の共通部分である品目セットを追加し、その大品目セットL(k−1)の最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ共通部分に追加して候補品目セットC(k)を生成するとともに、ルール検証用品目セットLL(k−1)を生成してハッシュ木に追加した後にハッシュ木のための記憶容量を計算し、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットC(k)および各ルール検証用品目セットLL(k−1)の支持度を計算し、候補品目セットC(k)のうち、支持度が所定の基準値より大きいものを大品目セットL(k)として保存し、ルール検証用品目セットLL(k−1)および大品目セットL(k)の支持度より計算される確信度またはχ2乗値に基づいて大品目セットL(k)から相関ルールを生成し、その後にハッシュ木を消去するようにしたので、各大品目セットの処理毎にハッシュ木の使用する記憶容量を調べることになり、予め割り当てられた記憶容量を有効に使用することができるという効果が得られる。
【0078】
実施の形態2.
この発明の実施の形態2による相関ルール抽出装置は、ルール検証用品目セットの支持度の計算についての処理を実施の形態1のものから変更したものである。ここでは、実施の形態2におけるルール検証用品目セットの支持度の計算についてのみ説明し、その他の処理については実施の形態1と同様であるのでその説明を省略する。
【0079】
実施の形態2による相関ルール抽出装置においては、ルール検証用品目セットの支持度は、候補品目セット検証手段21によりデータベース1のレコードを参照して行われる。そのとき候補品目セット検証手段21は、データベース1からレコードを順次読み出し、各レコードと候補品目セットとのマッチングをするとともに、各レコードとルール検証用品目セットとのマッチングも並行して行う。
【0080】
そして、候補品目セット検証手段21は、データベース1のレコードにおける各候補品目セットの出現数および各ルール検証用品目セットの出現数をカウントして支持度を計算する。
【0081】
以上のように、この実施の形態2によれば、データベース1から読み出したレコードに対して、候補品目セットおよびルール検証用品目セットのマッチングを並行して実行するようにしたので、大品目セットが多い場合には、大品目セットファイル3に保存された大品目セットを検索するより短い時間で各ルール検証用品目セットの支持度を計算することができるという効果が得られる。
【0082】
実施の形態3.
この発明の実施の形態3による相関ルール抽出装置は、候補品目セットの支持度の計算についての処理を実施の形態1によるものから変更したものである。ここでは、実施の形態1における候補品目セットの支持度の計算についてのみ説明し、その他の処理については実施の形態1と同様であるのでその説明を省略する。
【0083】
実施の形態3においては、候補品目セット検証手段21は、候補品目セットの支持度を計算する際に、この計算とは関係ないルール検証用品目セットの部分木をハッシュ木から一時的に切り離し、この計算の終了後にその部分木をハッシュ木の元の位置に戻す。このとき候補品目セット検証手段21は、ハッシュ木の切り離し位置に隣接する接続ノードと、その部分木のルートであるノードとの対応関係を記憶しておき、支持度の計算終了後に、その対応関係に基づいて、その部分木をハッシュ木の元の位置に戻す。
【0084】
図8はハッシュ木から部分木を切り離す位置の一例を示す図である。図9はハッシュ木と、切り離した部分木との対応関係の一例を示す図である。例えば、図8に示すハッシュ木においては、候補品目セットが[2,4,5,6],[2,4,5,7]であり、その他の枝がすべてルール検証用セットの枝である。したがって○印を付されたノードがハッシュ木から切り離されるが、このとき、切り離し位置を可能な限り少なく設定する。例えばルートから順番に下位へノードを探索していき、ノードの品目が、いずれの候補品目セットの対応する位置にも出現しない場合にそのノードへのリンクが切り離し位置に設定される。
【0085】
すなわち、図8のハッシュ木においては、品目「4」が候補品目セットの第1品目に出現しないので、ルートから品目「4」のノードへのリンクが切り離し位置とされる。同様に、品目「5」が候補品目セットの第2品目に出現しないので、品目「2」のノードから品目「5」のノードへのリンクが切り離し位置とされ、品目「6」,「7」が候補品目セットの第3品目に出現しないので、品目「4」のノードから品目「6」,「7」のノードへのリンクがそれぞれ切り離し位置とされる。
【0086】
そして、図9(a)に示すように切り離し位置に隣接するルートおよび品目「4」のノードへのポインタがa,d、品目「2」のノードおよび品目「5」のノードへのポインタがb,c、品目「4」のノードおよび品目「6」,「7」のノードへのポインタがe,f,gである場合には、図9(b)に示すように、切り離し位置に隣接する2つのノードへのポインタが関連づけられて記憶される。このように、ハッシュ木の切り離し位置に隣接する接続ノードと、部分木のルートであるノードとの対応関係を記憶した後、ルートおよび品目「2」,「4」,「5」ノードの下位ノードへのリンク情報を書き換えて部分木を切り離し、支持度の計算終了後に、その対応関係(図9(b))に基づいて、ルートおよび品目「2」,「4」,「5」ノードの下位ノードへのリンク情報を元に戻してその部分木をハッシュ木の元の位置に戻す。
【0087】
以上のように、この実施の形態3によれば、候補品目セットの支持度の計算に関係のないルール検証用品目セットの部分木をハッシュ木から切り離すようにしたので、候補品目セットの支持度の計算に関係のないルール検証用品目セットについてのマッチングが行われず、効率的に候補品目セットのマッチングを実行することができるという効果が得られる。
【0088】
実施の形態4.
この発明の実施の形態4による相関ルール抽出装置は、ハッシュ木の接続ノードと、ルール検証用品目セットの部分木のルートとの対応関係を示すデータをスタックによるデータ構造に従って記憶し、そのデータに基づいて、切り離した部分木をハッシュ木の元の位置に戻すようにしたものである。その他の処理については実施の形態3と同様であるのでその説明を省略する。
【0089】
実施の形態4においては、候補品目セット検証手段21は、ハッシュ木の切り離し位置に隣接する接続ノードと、その部分木のルートであるノードとの対応関係を、一定の記憶容量のスタック領域において、スタックによるデータ構造に従って順次記憶していき、支持度の計算終了後に、その対応関係をスタックから順次読み出して、その部分木をハッシュ木の元の位置に戻す。
【0090】
図10はハッシュ木と、切り離した部分木との対応関係を記憶するスタックの一例を示す図である。例えば図8のハッシュ木からルール検証用品目セットの部分木を切り離す場合、図10に示すように、切り離し位置に隣接する2つのノードへのポインタが関連づけられてスタックに記憶されていき、支持度の計算終了後に、逆順にスタックから読み出され、部分木が元の位置に戻される。
【0091】
以上のように、この実施の形態4によれば、実施の形態3による効果の他、ハッシュ木の接続ノードと、ルール検証用品目セットの部分木のルートとの対応関係を示すデータをスタックによるデータ構造に従って記憶するようにしたので、メモリ管理を簡単化することができるという効果が得られる。
【0092】
実施の形態5.
この発明の実施の形態5による相関ルール抽出装置は、ハッシュ木の接続ノードと、ルール検証用品目セットの部分木のルートとの対応関係を示すデータをリストによるデータ構造に従って記憶し、そのデータに基づいて、切り離した部分木をハッシュ木の元の位置に戻すようにしたものである。その他の処理については実施の形態3と同様であるのでその説明を省略する。
【0093】
実施の形態5においては、候補品目セット検証手段21は、ハッシュ木の切り離し位置に隣接する接続ノードと、その部分木のルートであるノードとの対応関係をリストによるデータ構造に従って順次記憶していき、支持度の計算終了後に、その対応関係をリストから順次読み出して、その部分木をハッシュ木の元の位置に戻す。
【0094】
図11はハッシュ木と、切り離した部分木との対応関係を記憶するリストの一例を示す図である。例えば図8のハッシュ木からルール検証用品目セットの部分木を切り離す場合、図11(a)に示すように、切り離された部分木のルートを一連のリストとして、図11(b)に示すように、切り離し位置に隣接する2つのノードへのポインタが関連づけられたレコードがリストとして記憶されていき、支持度の計算終了後に、各レコードがリストから順次読み出され、部分木が元の位置に戻される。
【0095】
以上のように、この実施の形態5によれば、実施の形態3による効果の他、ハッシュ木の接続ノードと、ルール検証用品目セットの部分木のルートとの対応関係を示すデータをリストによるデータ構造に従って記憶するようにしたので、切り離し位置の数がいくつでもよく、また不要な記憶領域を予め確保する必要がなくメモリを効率良く使用することができるという効果が得られる。
【0096】
実施の形態6.
この発明の実施の形態6による相関ルール抽出装置は、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、直前に追加された大品目セットの共通部分、候補品目セットおよびルール検証用品目セットをハッシュ木から削除するようにしたものである。その他の処理については実施の形態1と同様であるのでその説明を省略する。
【0097】
実施の形態6においては、ハッシュ木操作手段23は、読み出した大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加後のハッシュ木のための記憶容量を計算するが、ハッシュ木のための記憶容量が所定の基準値より大きい場合には、ハッシュ木から、これらの大品目セットの共通部分、候補品目セットおよびルール検証用品目セットに対応する部分木を削除する。
【0098】
この後に候補品目セット検証手段21は残りの候補品目セットおよびルール検証用品目セットの支持度を計算する。なお、このとき削除された大品目セットは、ハッシュ木が消去された後に、再度読み込まれて処理される。
【0099】
以上のように、この実施の形態6によれば、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、直前に追加した大品目セットの共通部分、候補品目セットおよびルール検証用品目セットをハッシュ木から削除し、ハッシュ木のための記憶容量が所定の基準値以下である状態に戻した後、支持度の計算などを実行するようにしたので、使用記憶容量をより正確に制限することができるという効果が得られる。
【0100】
実施の形態7.
この発明の実施の形態7による相関ルール抽出装置は、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量のうちの最大値が所定の記憶領域の残量より大きくなった場合に、大品目セットおよび相関ルールを生成し、その後にハッシュ木を消去する処理を実行するようにしたものである。その他の処理については実施の形態1と同様であるのでその説明を省略する。
【0101】
実施の形態7においては、ハッシュ木操作手段23は、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットLL(k−1)がハッシュ木に追加された後に、ハッシュ木のための記憶容量を計算し、その計算結果と前回の計算結果との差を計算してハッシュ木のための記憶容量の増加量を計算する。次にハッシュ木操作手段23は、その増加量と、前回までの増加量の最大値とを比較し、その増加量の値がその最大値より大きい場合には、その増加量の値でその最大値を更新する。そしてハッシュ木操作手段23は、所定の基準値と今回計算したハッシュ木のための記憶容量との差である記憶容量の残量を計算し、その残量より上述の最大値が大きい場合には、大品目セットおよび相関ルールを生成し、その後にハッシュ木を消去する処理を実行させ、そうでない場合には、次の大品目セットを読み込み処理する。
【0102】
以上のように、この実施の形態7によれば、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量のうちの最大値が所定の記憶領域の残量より大きくなった場合に、大品目セットおよび相関ルールを生成し、その後にハッシュ木を消去する処理を実行するようにしたので、ハッシュ木のための記憶容量が所定の基準値を超える手前まで有効にメモリが使用されるという効果が得られる。
【0103】
実施の形態8.
この発明の実施の形態8による相関ルール抽出装置は、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量の平均値が所定の記憶領域の残量より大きくなった場合に、大品目セットおよび相関ルールを生成し、その後にハッシュ木を消去する処理を実行するようにしたものである。その他の処理については実施の形態1と同様であるのでその説明を省略する。
【0104】
実施の形態8においては、ハッシュ木操作手段23は、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットLL(k−1)がハッシュ木に追加された後に、ハッシュ木のための記憶容量を計算し、その計算結果と前回の計算結果との差を計算してハッシュ木のための記憶容量の増加量を計算する。次にハッシュ木操作手段23は、その増加量、前回までの増加量の平均値および追加の回数に基づいて今回までの増加量の平均値を計算する。そしてハッシュ木操作手段23は、所定の基準値と今回計算したハッシュ木のための記憶容量との差である記憶容量の残量を計算し、その残量より上述の平均値が大きい場合には、大品目セットおよび相関ルールを生成し、その後にハッシュ木を消去する処理を実行させ、そうでない場合には、次の大品目セットを読み込み処理する。
【0105】
以上のように、この実施の形態8によれば、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量の平均値が所定の記憶領域の残量より大きくなった場合に、大品目セットおよび相関ルールを生成し、その後にハッシュ木を消去する処理を実行するようにしたので、ハッシュ木のための記憶容量が所定の基準値を超える手前まで有効にメモリが使用されるという効果が得られる。
【0106】
実施の形態9.
図12はこの発明の実施の形態9による相関ルール抽出装置の構成を示すブロック図である。図において、1Aは複数のレコードを表形式で保存し、レシート形式のデータを保存するデータベースである。ここでレシート形式とは、データベース1Aのレコードにおける各属性の値に対する品目を連続させて表したものである。なお、このときの品目は例えば(属性番号|属性値)なる2次元インデックスとされる。この場合、属性「性別」の値として「男」,「女」があり、属性「身長」の値として「大」,「中」,「小」があった場合、これらの属性の値は(1|1),(1|2)および(2|1),(2|2),(2|3)なる2次元インデックスの品目でそれぞれ表される。
【0107】
51はデータベース1Aのレシート形式のレコードを読み出し、レコードに含まれる品目に基づいて各品目数の大品目セットをハッシュ木として展開していくとともに、その大品目セットから、確信度またはχ2乗値に基づいて相関ルールを生成する相関ルール抽出部である。52はデータベース1Aの表形式のレコードを読み出してレシート形式に変換して、変換後のレコードをデータベース1Aに保存するレシートファイル生成手段(データ変換手段)である。
【0108】
相関ルール抽出部51において、2Aはデータベース1Aに保存された2次元インデックス形式の品目に対応して処理を実行する候補品目セット検証手段21A、候補品目セット生成手段22Aおよびハッシュ木操作手段23Aを有する大品目セット生成手段である。
【0109】
なお、相関ルール抽出部51におけるその他の構成要素については、実施の形態1(図1)におけるものと同様であるのでその説明を省略する。
【0110】
次に動作について説明する。
図13は表形式の一例を示す図であり、図14はレシート形式でデータベース1Aに保存されたレコードの一例を示す図であり、図15はレシート形式の品目により構成されるハッシュ木の一例を示す図である。
【0111】
まず、レシートファイル生成手段52は、例えば図13に示すような表形式で保存されたレコードを読み出し、表の各属性に対応して付される属性番号と、読み出したレコードにおけるその属性番号に対応する属性に対応して付される番号(属性値)とで構成される2次元インデックス形式(属性番号|属性値)のデータをレコードの各属性値毎に生成してデータベース1Aに保存させる。
【0112】
次に、相関ルール抽出部51の大品目セット生成手段2Aは、データベース1Aからレシート形式のデータを適宜読み出して、メモリ6にハッシュ木を展開していき、実施の形態1と同様に各品目数の大品目セットを順次生成していく。
【0113】
ただし、ハッシュ木操作手段23Aおよび候補品目セット生成手段22Aがハッシュ木の枝伸ばしを実行する際に下記の規則に従って実行し、下記の規則に従わない品目はハッシュ木に追加されない。
規則1.属性番号が大きい品目ほど、その品目は「大」であるとする。例えば(4|1)>(2|3)である。
規則2.属性番号が同じ場合、属性値が大きいほど、その品目は「大」であるとする。例えば(3|5)>(3|2)である。
規則3.あるノードの品目の属性番号は、その上位のノードの品目の属性番号よりも大きくなければならない。例えば図15のハッシュ木において、枝「(1|1),(2|1)」の下位に、品目「(2|3)」のノードは追加されない。
【0114】
このようにすることにより、ハッシュ木のノードである品目の下位に追加できる品目が、同一の属性番号を有しない品目だけに制限されるため、同じ属性における属性値で構成される品目セットは生成されない。
【0115】
そして、相関ルール抽出部51の仮説生成検証手段4は実施の形態1と同様にして相関ルールを生成する。
【0116】
以上のように、この実施の形態9によれば、属性番号と属性値で構成される2次元インデックスとしてデータベースに各品目を保存し、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成するようにしたので、同じ属性における属性値の相関ルールの生成を抑制することができ、負の相関ルールの生成を抑制することができるという効果が得られる。
【0117】
なお、上記実施の形態9においては、レシートファイル生成手段52によりデータベース1Aに記録されているデータの形式をレシート形式に変換するようにしているが、最初からレシート形式のデータをデータベース1Aに記録するようにしてもよい。その場合には、レシートファイル生成手段52は特に必要ない。
【0118】
また、上記実施の形態9においては、相関ルール抽出部51が実施の形態1によるものとほぼ同様に構成されているが、相関ルール抽出部51はこのように限定されるものではなく、ハッシュ木に品目セットを展開しながら大品目セットを生成していくものであれば他のものでもよい。
【0119】
実施の形態10.
この発明の実施の形態10による相関ルール抽出装置は、実施の形態9による相関ルール抽出装置において互いに相関ルールを生成しない複数の属性を指定可能にしたものである。その他の処理については実施の形態9と同様であるのでその説明を省略する。
【0120】
実施の形態10においては、互いに相関ルールを生成しない複数の属性を属性グループとし、その属性グループの属性の値は、(属性グループ番号|属性値)なる品目に変換される。例えば、属性「問診1」および属性「問診2」を属性グループと設定し、属性「問診1」の値が「a」,「b」であり、属性「問診2」の値が「a」,「b」,「c」である場合には、これらの属性の値は、(1|1),(1|2),(1|3)および(1|4),(1|5)なる品目に変換される。
【0121】
そしてハッシュ木の枝伸ばしを実行する際に実施の形態9と同様に下記の規則に従い、下記の規則に従わない品目はハッシュ木に追加されない。
規則1.属性グループ番号が大きい品目ほど、その品目は「大」であるとする。例えば(4|1)>(2|3)である。
規則2.属性グループ番号が同じ場合、属性値が大きいほど、その品目は「大」であるとする。例えば(3|5)>(3|2)である。
規則3.あるノードの品目の属性グループ番号は、その上位のノードの品目の属性グループ番号よりも大きくなければならない。例えば図15のハッシュ木において、枝「(1|1),(2|1)」の下位に、品目「(2|3)」のノードは追加されない。
【0122】
以上のように、この実施の形態10によれば、実施の形態9による効果の他、互いに相関ルールを生成しない属性に対応する品目については同一の属性グループ番号を使用するようにしたので、不要な相関ルールの生成を抑制することができ、そのような相関ルールを除去する後処理を省略することができるという効果が得られる。
【0123】
実施の形態11.
この発明の実施の形態11による相関ルール抽出装置は、大品目セットの品目数がkであるとき、大品目セットを品目数が1から(k−1)までの条件部と品目数が(k−1)から1までの帰結部とに分割してそれぞれ生成されるルールのうち、確信度またはχ2乗値が所定の基準値より大きいものを相関ルールとするものである。
【0124】
実施の形態11においては、(k−1)≧Nc≧1であるすべての整数Ncについて、条件部の品目数がNcであり、帰結部の品目数が(k−Nc)であるルールが大品目セットL(k)から生成される。
【0125】
例えば、大品目セット「2,4,5,6」から、ルール「2,4,5→6」,「2,4,6→5」,「2,5,6→4」,「4,5,6→2」、ルール「2,4→5,6」,「2,5→4,6」,「2,6→4,5」,「4,5→2,6」、「4,6→2,5」,「5,6→2,4」およびルール「2→4,5,6」,「4→2,5,6」,「5→2,4,6」,「6→2,4,5」が生成される。同様に、大品目セット「2,4,5,7」から、ルール「2,4,5→7」,「2,4,7→5」,「2,5,7→4」,「4,5,7→2」、ルール「2,4→5,7」,「2,5→4,7」,「2,7→4,5」,「4,5→2,7」、「4,7→2,5」,「5,7→2,4」およびルール「2→4,5,7」,「4→2,5,7」,「5→2,4,7」,「7→2,4,5」が生成される。
【0126】
図16はルールの条件部の品目数が1〜(k−1)である場合に生成されるルール検証用品目セットLL(1)〜LL(k−1)を追加したハッシュ木の値例を示す図である。例えば実施の形態1のように大品目セットを生成する場合においては、このルールの条件部に相当するルール検証用品目セットLL(1)〜LL(k−1)が図16に示すようにハッシュ木に追加される。
【0127】
そして、生成された各ルールについて、確信度またはχ2乗値が計算され、所定の基準値より高い確信度またはχ2乗値を有するルールが相関ルールとして保存される。
【0128】
なお、確信度またはχ2乗値を計算する際、品目数が1〜(k−1)であるルールの条件部の支持度が必要になるが、例えば実施の形態1のように大品目セットを生成する場合においては、生成した大品目セットL(1)〜L(k−1)を大品目セットファイル3から削除せずに保存しておくことにより、品目数が1〜(k−1)であるルールの条件部と同一の大品目セットを大品目ファイル3で検索してルールの条件部の支持度を取得することができる。
【0129】
そして例えば図16に示すハッシュ木においてそのルールの条件部に相当するルール検証用品目セットLL(i)(i=1〜(k−1))に関連づけて記憶される。
【0130】
以上のように、この実施の形態11によれば、品目数がkである大品目セットから相関ルールの候補を作成する際に、条件部の品目数が1〜(k−1)であり、帰結部の品目数が(k−1)〜1である候補のルールをそれぞれ生成するようにしたので、帰結部が2以上の相関ルールを生成することができるという効果が得られる。
【0131】
さらに、生成した大品目セットL(1)〜L(k−1)を保存しておき、ルールの条件部の支持度として使用するようにしたので、帰結部が2以上の相関ルールを生成する際にも、簡単に確信度またはχ2乗値を計算することができるという効果が得られる。
【0132】
なお、この実施の形態11による相関ルール抽出装置における大品目セットの生成手順は、上記実施の形態1〜実施の形態10によるものに限定されるものではなく、大品目セットをファイルに格納して管理する任意のアルゴリズムで有効である。
【0133】
実施の形態12.
図17はこの発明の実施の形態12による相関ルール抽出装置の構成を示すブロック図である。実施の形態12による相関ルール抽出装置は、上述の実施の形態1〜実施の形態11による処理手順を記述したプログラムに従って動作するいわゆるコンピュータによるものである。
【0134】
図において、71はROM72、ハードディスクドライブ装置74、記録媒体91などに予め記録されたプログラム81,81Aに従って各種処理を実行するCPU(相関ルール生成手段、支持度計算手段、候補品目セット生成手段、ルール検証用品目セット生成手段、共通品目セット追加手段、記憶容量計算手段、相関ルール抽出部、データ変換手段)であり、72は起動時に実行されるプログラムや各種処理に必要なデータなどを予め記憶するROMであり、73はハードディスクドライブ装置74や記録媒体91に予め記録されたプログラム81,81Aをロードされるとともに、各種処理において各種データを一時的に記憶するRAM(記憶手段)である。
【0135】
74は上述の処理を記述したプログラム81、データベース1,1A、大品目セットファイル3、相関ルール集合ファイル5などを保存するハードディスクドライブ装置であり、75は記録媒体91に対してデータの読み書きを実行する記録媒体駆動装置である。なお、CPU71、ROM72、RAM73、ハードディスクドライブ装置74および記録媒体駆動装置75は互いにデータバスやアドレスバスで接続されている。なお、このバス構成は一例であり他の構成でもよい。91は上述の処理を記述したプログラム81Aを記録されたフレキシブルディスク、CD−ROM(Compact Disc-Read Only Memory)などのコンピュータ読み取り可能な記録媒体である。
【0136】
次に動作について説明する。
まず、ユーザによる操作などに対応してCPU71が、ハードディスクドライブ装置74に記録されたプログラム81または記録媒体91に記憶されたプログラム81AをRAM73にロードして、そのプログラムに従って上述の実施の形態1〜実施の形態11に記載の各種処理を実行する。すなわち、CPU71が上述の大品目セット生成手段2,2Aおよび仮説生成検証手段4として動作し、RAM73がメモリ6として機能する。
【0137】
以上のように、この実施の形態12によれば、上述の実施の形態1〜実施の形態11による処理手順を記述したプログラムをコンピュータで実行して上述の各種処理を実行するようにしたので、上述の実施の形態1〜実施の形態11による効果と同様の効果が得られる。
【0138】
【発明の効果】
以上のように、この発明によれば、所定の保存手段から大品目セットを最後の品目以外の品目が共通するもの毎に読み出し、所定の記憶手段に記憶されたハッシュ木に、大品目セットの共通部分である品目セットを追加し、読み出した大品目セットの最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ共通部分に追加して候補品目セットを生成し、各候補品目セットの一部であって候補品目セットより品目数が1だけ少ない品目セットをルール検証用品目セットとしてハッシュ木に追加し、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加後のハッシュ木のための記憶容量を計算し、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットおよび各ルール検証用品目セットの支持度を計算し、候補品目セットのうち、支持度が所定の基準値より大きいものを大品目セットとして所定の保存手段に保存し、ルール検証用品目セットおよび大品目セットの支持度より計算される確信度またはχ2乗値に基づいて大品目セットから相関ルールを生成し、その後にハッシュ木を所定の記憶手段から消去するように構成したので、各大品目セットの処理毎にハッシュ木の使用する記憶容量を調べることになり、予め割り当てられた記憶容量を有効に使用することができるという効果がある。
【0139】
この発明によれば、大品目セットとともにその支持度を保存手段に保存し、各ルール検証用品目セットと同一の大品目セットが保存手段に保存されている場合には、その大品目セットの支持度をそのルール検証用品目セットの支持度とするように構成したので、大品目セットが少ない場合には、短い時間で各ルール検証用品目セットの支持度を取得することができるという効果がある。
【0140】
この発明によれば、データベースからレコードを読み出し、候補品目セットの出現数およびルール検証用品目セットの出現数を並行してカウントして候補品目セットの支持度およびルール検証用品目セットの支持度を計算するように構成したので、大品目セットが多い場合には、保存手段に保存された大品目セットを検索するより短い時間で各ルール検証用品目セットの支持度を計算することができるという効果がある。
【0141】
この発明によれば、ハッシュ木からルール検証用品目セットに対応する部分木を切り離した後、各候補品目セットの支持度を計算し、支持度の計算後、ルール検証用品目セットに対応する部分木をハッシュ木の元の位置に戻すように構成したので、候補品目セットの支持度の計算に関係のないルール検証用品目セットについてのマッチングが行われず、効率的に候補品目セットのマッチングを実行することができるという効果がある。
【0142】
この発明によれば、切り離した部分木が接続されていたハッシュ木の接続ノードとその部分木のルートとの対応関係を示すデータをスタックによるデータ構造に従って記憶し、そのデータに基づいて、切り離した部分木をハッシュ木の元の位置に戻すように構成したので、メモリ管理を簡単化することができるという効果がある。
【0143】
この発明によれば、切り離した部分木が接続されていたハッシュ木の接続ノードとその部分木のルートとの対応関係を示すデータをリストによるデータ構造に従って記憶し、そのデータに基づいて、切り離した部分木をハッシュ木の元の位置に戻すように構成したので、切り離し位置の数がいくつでもよく、また不要な記憶領域を予め確保する必要がなくメモリを効率良く使用することができるという効果がある。
【0144】
この発明によれば、ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、直前に追加された大品目セットの共通部分、候補品目セットおよびルール検証用品目セットをハッシュ木から削除するように構成したので、使用記憶容量をより正確に制限することができるという効果がある。
【0145】
この発明によれば、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量のうちの最大値が、所定の基準値とハッシュ木のための記憶容量との差より大きくなった場合に、支持度を計算し、相関ルールを生成し、その後にハッシュ木を消去するように構成したので、ハッシュ木のための記憶容量が所定の基準値を超える手前まで有効にメモリが使用されるという効果がある。
【0146】
この発明によれば、大品目セットの共通部分、候補品目セットおよびルール検証用品目セットの追加によるハッシュ木のための記憶容量の増加量の平均値が、所定の基準値とハッシュ木のための記憶容量との差より大きくなった場合に、支持度を計算し、相関ルールを生成し、その後にハッシュ木を消去するように構成したので、ハッシュ木のための記憶容量が所定の基準値を超える手前まで有効にメモリが使用されるという効果がある。
【0147】
この発明によれば、属性番号と属性値で構成される2次元インデックスとして各品目をデータベースに保存し、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出するように構成したので、同じ属性における属性値の相関ルールの生成を抑制することができ、負の相関ルールの生成を抑制することができるという効果がある。
【0148】
この発明によれば、データベースに、各品目の値を、属性番号と属性値で構成される2次元インデックスとして、または、そのデータベースの複数の属性で構成される属性グループについての属性グループ番号とそれらのうちのいずれかの属性値で構成される2次元インデックスとして保存し、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号または属性グループ番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出するように構成したので、不要な相関ルールの生成を抑制することができ、そのような相関ルールを除去する後処理を省略することができるという効果がある。
【0149】
この発明によれば、所定の表形式でデータベースに予め保存されたレコードの各属性値を2次元インデックスに変換し、その2次元インデックスをデータベースに保存するデータ変換手段を備えるようにしたので、データベースに表形式でレコードが記録されていても2次元インデックスに変換され、同様に、同じ属性における属性値の相関ルールの生成を抑制することができ、負の相関ルールの生成を抑制することができるという効果がある。
【0150】
この発明によれば、所定の保存手段に保存された大品目セットのうち、最後の品目以外の品目が共通する大品目セットから、その大品目セットより品目数が1だけ多い候補品目セットを生成し、候補品目セットの支持度を計算し、その支持度に基づいて候補品目セットと同一品目数の大品目セットを生成して保存手段に保存するステップと、大品目セットの品目数をkとして、大品目セットを、品目数が1から(k−1)までの条件部と品目数が(k−1)から1までの帰結部とに分割してそれぞれ生成されるルールのうち、確信度またはχ2乗値が所定の基準値より大きいものを相関ルールとするように構成したので、帰結部が2以上の相関ルールを生成することができるという効果がある。
【0151】
この発明によれば、大品目セットを保存手段に保存する際に、その大品目セットの支持度も保存し、ルールの条件部と同一の大品目セットが保存手段に保存されている場合には、その大品目セットの支持度をそのルールの条件部の支持度としてルールの確信度またはχ2乗値を計算するように構成したので、帰結部が2以上の相関ルールを生成する際に、簡単に確信度またはχ2乗値を計算することができるという効果がある。
【図面の簡単な説明】
【図1】 この発明の実施の形態1による相関ルール抽出装置の構成を示すブロック図である。
【図2】 実施の形態1による相関ルール抽出装置の動作について説明するフローチャートである。
【図3】 大品目セットファイルの内容の一例を示す図である。
【図4】 図3の大品目セット[1,2,3],[1,2,4],[1,3,5],[1,4,5]で構成されるハッシュ木を示す図である。
【図5】 図2のステップST3における動作の一例について説明する図である。
【図6】 図2のステップST4における動作の一例について説明する図である。
【図7】 図2のステップST5における動作の一例について説明する図である。
【図8】 ハッシュ木から部分木を切り離す位置の一例を示す図である。
【図9】 ハッシュ木と、切り離した部分木との対応関係の一例を示す図である。
【図10】 ハッシュ木と、切り離した部分木との対応関係を記憶するスタックの一例を示す図である。
【図11】 ハッシュ木と、切り離した部分木との対応関係を記憶するリストの一例を示す図である。
【図12】 この発明の実施の形態9による相関ルール抽出装置の構成を示すブロック図である。
【図13】 表形式の一例を示す図である。
【図14】 レシート形式でデータベースに保存されたレコードの一例を示す図である。
【図15】 レシート形式の品目により構成されるハッシュ木の一例を示す図である。
【図16】 ルールの条件部の品目数が1〜(k−1)である場合に生成されるルール検証用品目セットLL(1)〜LL(k−1)を追加したハッシュ木の値例を示す図である。
【図17】 この発明の実施の形態12による相関ルール抽出装置の構成を示すブロック図である。
【図18】 従来の相関ルール抽出装置の構成例を示すブロック図である。
【図19】 大品目セットを示すハッシュ木の一例を示す図である。
【図20】 先に提案した第1の手法について説明する図である。
【図21】 先に提案した第2の手法について説明する図である。
【符号の説明】
1,1A データベース、3 大品目セットファイル(保存手段)、4 仮説生成検証手段(相関ルール生成手段)、6 メモリ(記憶手段)、21 候補品目セット検証手段(支持度計算手段)、22 候補品目セット生成手段(候補品目セット生成手段、ルール検証用品目セット生成手段)、23 ハッシュ木操作手段(共通品目セット追加手段、記憶容量計算手段)、51 相関ルール抽出部、52 レシートファイル生成手段(データ変換手段)、71 CPU(相関ルール生成手段、支持度計算手段、候補品目セット生成手段、ルール検証用品目セット生成手段、共通品目セット追加手段、記憶容量計算手段、相関ルール抽出部、データ変換手段)、73 RAM(記憶手段)、81A プログラム、91 記録媒体。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a correlation rule extraction apparatus, a correlation rule extraction method, and a recording medium for extracting a correlation rule between item sets in a database from a plurality of records recorded in the database.
[0002]
[Prior art]
FIG. 18 is a block diagram showing a configuration example of a conventional correlation rule extraction device. In this conventional correlation rule extraction apparatus, for example, “Fast Algorithms for Mining Association Rules” (Agrawal et al., Proc. Of the 20th VLDB Conference, Santiago, Chile, 1994) and Japanese Patent Application Laid-Open No. 8-287106 are disclosed. Based on the (Apriori) method, a correlation rule between item sets in the database is extracted from a plurality of records recorded in the database. In the a priori method, the ratio of records including the item set “A, B,..., X, Y” out of all records is defined as the support level, and the rule “A, B,. The ratio of the records that include the item “Y” in the consequent part among the records that include the item set “A, B,... When the value is higher than the reference value, the rule “A, B,..., X → Y” is extracted as the correlation rule.
[0003]
In FIG. 18,
[0004]
In the large item
[0005]
In the hypothesis generation verification means 104, 31 is a rule for generating all rules composed of a condition part of (k-1) items and a result part of one item from a large item set having k items. Candidate generating means 33 is a certainty factor calculating means 33 for calculating the certainty factor of the rule generated by the rule candidate generating means 31 with reference to the large item set.
[0006]
Next, the operation will be described.
First, the candidate item set
[0007]
Next, the candidate item
[0008]
Then, the candidate item set generation means 122 is configured so that (k−2) items are common and two large item sets among a plurality of large item sets having the number of items (k−1) are ( k-2) A candidate item set is generated in which the number of items composed of two common items and two different items in the large item set is k. Similarly, the large item
[0009]
On the other hand, in the hypothesis generation verification means 104, the rule candidate generation means 31 determines that the condition item of (k−1) items and one item from the large item set whose number of items is k by the candidate item set verification means 121. Generate all rules that consist of the consequences of an item. Then, the certainty factor calculating unit 33 refers to the large item set, calculates the certainty factor of the rule generated by the rule
[0010]
In this way, a large item set for each number of items is generated, and a correlation rule is extracted based on the large item set.
[0011]
When holding a large item set, the data structure is often held in a memory or the like as a hash tree. FIG. 19 is a diagram illustrating an example of a hash tree indicating a large item set. In this hash tree, each item constitutes a node, and one item set constitutes one branch from a root to a predetermined lower node. For example, in FIG. 19, the branch from the root to the
[0012]
That is, by repeating the generation of a large item set as described above, a branch is added to the hash tree every time the large item set increases, and each time the number of items increases, the number of nodes constituting the branch is increased to extend the branch. I will do it. In the hash tree, all branches constitute one large item set.
[0013]
In this way, a large item set having a different number of items can be expressed in a tree structure by utilizing the property that a subset in the large item set always becomes a large item set. The subset in the large item set is an item set including (k−1) or less items of k items constituting the large item set.
[0014]
In this way, by holding a plurality of large item sets as a hash tree, the storage capacity required for holding the large item sets is reduced as compared with the case where the large item sets are simply stored sequentially.
[0015]
However, if the number of items is large even if a hash tree is used, the hash tree itself becomes large, and a memory having a large storage capacity is required to generate a large item set. Moreover, when the memory capacity of the memory is small and the virtual storage method is adopted, there is a problem that paging occurs frequently and the time required for processing becomes long.
[0016]
Other conventional techniques described above include JP-A-8-161287, JP-A-8-263346, JP-A-8-272825, JP-A-8-314981, and JP-A-9-34721. And those described in JP-A-10-269248.
[0017]
Therefore, in order to solve such a problem, the present applicant previously proposed a method for suppressing paging in Japanese Patent Application No. 10-182416. FIG. 20 is a diagram for explaining the previously proposed first method, and FIG. 21 is a diagram for explaining the previously proposed second method.
[0018]
In the first method proposed previously, a large item set is stored in a file, and the large item set is read from the file one by one and added to the hash tree. All candidate item sets generated from the large item set being added are added to the hash tree.
[0019]
Here, when generating a candidate item set corresponding to a large item set, add nodes of items with numbers higher than the last item of the large item set in parallel to the lower items of the large item set. A branch of candidate item sets is generated. For example, when there are 10 items from 1 to 10 and a candidate item set is generated corresponding to the large item set [1, 3, 5], the branch of the large item set [1, 3, 5]
[0020]
The above-described series of processing is sequentially executed for each large item set having the same number of items. Then, for each series of processing, the storage capacity occupied by the hash tree is calculated. When the value exceeds a predetermined reference value, the candidate item set added to the hash tree is matched with the record. The support level is calculated and a large item set whose number of items is one larger than the large item set stored in the file is generated as shown in FIG. 20, and all large item sets are generated and updated in a batch. . Therefore, a large item set having the same number of items is always stored in the file. Note that candidate item sets that have not become large item sets are deleted.
[0021]
Then, an item set necessary for rule validation (rule validation item set), that is, an item set that is a subset of the large item set, which is one less than the large item set, is also added to the hash tree. . After generating the association rules based on these subtrees, the added large item set and the subtree added for it are deleted. Then, the next large item set is added and processed in the same manner.
[0022]
In the previously proposed second method, branching similar to the a priori method is executed. In this method, all items other than the last item are the same until the data amount of the hash tree reaches a predetermined storage capacity that is a fraction of the storage capacity previously allocated for the hash tree. Item sets are collectively read from the file and added sequentially to the hash tree. Here, the large item set is read by a predetermined storage capacity that is a fraction of the pre-allocated storage capacity, and then the storage capacity necessary for adding the candidate item set and rule verification item set is increased. This is to keep it.
[0023]
A candidate item set is generated from a large item set in which all items other than the last item are the same. For example, when large item sets [2, 3, 5] and [2, 3, 7] are stored in a file, as shown in FIG. 21, these large item sets [2, 3, 5], [2 , 3, 7] are collectively read and added to the hash tree. Then, based on the last different items “5” and “7”, the item “7” is added to the large item set [2, 3, 5] to obtain the candidate item set “2, 3, 5, 7”. Is added.
[0024]
As described above, according to the first and second methods previously proposed, a large item set can be generated efficiently within the range of the storage capacity allocated in advance, and as a result, the association rules can be extracted efficiently. it can.
[0025]
[Problems to be solved by the invention]
The previously proposed method is configured as described above. Although the above-mentioned problem can be solved, the first method is different from the branch expansion similar to the a priori method in generating the candidate item set. Therefore, there is a problem that the number of candidate item sets for which the degree of support is calculated increases, and the processing time increases accordingly. Further, in the second method, when the data amount of a large item set reaches a fraction of the pre-allocated storage capacity, the remaining storage capacity is used to determine the large item set. Since a candidate item set or the like is added to the hash tree, there is a problem in that there is a possibility that all of the storage capacity allocated in advance may not be used effectively.
[0026]
In the above-described conventional technique, when extracting a correlation rule from tabular data, as preprocessing,
[0027]
Furthermore, in the above-described conventional technology, since only the correlation rule with the number of items in the result part is extracted, it is difficult to extract the correlation rule with the number of items in the result part being 2 or more. There was a problem.
[0028]
The present invention has been made to solve the above-described problems. A large item set is read for each item other than the last item in common, and an item set that is a common part of the large item set in the hash tree. , Select any two of the last set of items in the large item set in turn, add the two items to the common part to generate a candidate item set, and After the eye set is generated and added to the hash tree, the storage capacity for the hash tree is calculated, and when the storage capacity for the hash tree becomes larger than a predetermined reference value, each candidate item set and each rule verification Calculate the support level of the product item set, save the candidate item set with the support level larger than the specified reference value as a large item set, and the rule verification item set and large item set. Effectively use pre-allocated storage capacity by generating association rules from large item sets based on confidence or chi-square value calculated from the support of the network and then deleting the hash tree An object of the present invention is to obtain a correlation rule extraction device, a correlation rule extraction method, and a recording medium.
[0029]
In addition, each item is stored in the database as a two-dimensional index composed of attribute numbers and attribute values, and items that can be added to the lower level of items that are nodes of the hash tree are limited to items that do not have the same attribute number. It is an object of the present invention to obtain a correlation rule extraction device, a correlation rule extraction method, and a recording medium for suppressing generation of a correlation rule for attribute values in the same attribute so as to generate a large item set.
[0030]
Furthermore, when creating a correlation rule candidate from a large item set with k items, the number of items in the condition part is 1 to (k−1), and the number of items in the consequence part is (k−1) to It is an object to obtain a correlation rule extraction apparatus, a correlation rule extraction method, and a recording medium for generating a correlation rule having two or more consequents so that each rule is 1 is generated.
[0031]
[Means for Solving the Problems]
The correlation rule extracting apparatus according to the present invention has a storage means for storing a plurality of item sets as a hash tree, a storage means for storing a large item set, a large item set from the storage means, and items other than the last item in common. Read out every item to be read, and select either one of the common item set addition means that adds the common item set to the hash tree and the last item set of the large item set that was read out A candidate item set generating means for generating a candidate item set by adding the two items to a common part, and an item set that is a part of each candidate item set and has one less item than the candidate item set Rule validation item set generation means to add to the hash tree as a rule validation item set, common part of large item set, candidate item set and rule validation Storage capacity calculation means for calculating the storage capacity for the hash tree after the addition of the item set, and each candidate item set and each rule verification article when the storage capacity for the hash tree exceeds a predetermined reference value The degree of support of the eye set is calculated, and among the candidate item sets, the degree of support greater than a predetermined reference value is stored in the storage means as a large item set, and the storage capacity for the hash tree is predetermined. If the value exceeds the standard value, a correlation rule is generated from the large item set based on the certainty or chi-square value calculated from the support of the rule validation item set and the large item set, and then the hash tree is A correlation rule generating unit for deleting from the storage unit.
[0032]
The correlation rule extraction device according to the present invention stores the support level together with the large item set in the storage unit, and when the same large item set as each rule verification item set is stored in the storage unit, the large item set is stored in the storage unit. The support level of the item set is set as the support level of the rule verification item set.
[0033]
The correlation rule extraction device according to the present invention reads records from a database, counts the number of appearances of candidate item sets and the number of appearances of rule verification item sets in parallel, and supports the support level of candidate item sets and rule verification item sets. The degree of support is calculated.
[0034]
The correlation rule extraction device according to the present invention separates a subtree corresponding to the rule verification item set from the hash tree, calculates the support level of each candidate item set, and after calculating the support level, the rule verification item set The subtree corresponding to is returned to the original position of the hash tree.
[0035]
The correlation rule extracting apparatus according to the present invention stores data indicating a correspondence relationship between a connection node of a hash tree to which a separated subtree is connected and a root of the subtree according to a data structure of a stack, and based on the data Thus, the separated subtree is returned to the original position of the hash tree.
[0036]
The correlation rule extraction device according to the present invention stores data indicating a correspondence relationship between a connection node of a hash tree to which a separated subtree is connected and a root of the subtree according to a data structure of a list, and based on the data Thus, the separated subtree is returned to the original position of the hash tree.
[0037]
When the storage capacity for the hash tree becomes larger than a predetermined reference value, the correlation rule extraction device according to the present invention has a common part of a large item set added immediately before, a candidate item set, and a rule verification item set. Is deleted from the hash tree.
[0038]
In the correlation rule extraction device according to the present invention, the maximum value of the increase in the storage capacity for the hash tree due to the addition of the common part of the large item set, the candidate item set, and the rule verification item set is a predetermined reference value. And the storage capacity for the hash tree, the support level is calculated, an association rule is generated, and then the hash tree is deleted.
[0039]
The correlation rule extraction apparatus according to the present invention is configured such that an average value of an increase in storage capacity for a hash tree by adding a common part of a large item set, a candidate item set, and a rule verification item set is a predetermined reference value and a hash When the difference is larger than the storage capacity for the tree, the support level is calculated, an association rule is generated, and then the hash tree is deleted.
[0041]
The recording medium according to the present invention reads out a large item set from a predetermined storage means to a computer for each common item other than the last item, and stores the large items in a hash tree stored in the predetermined storage means. Procedure for adding an item set that is a common part of a set, selecting any two of the last set of items in a large item set that has been read out, and adding the two items to the common part in order Procedures for generating item sets, procedures for adding item sets that are part of each candidate item set and having one item less than the candidate item set to the hash tree as rule validation item sets, common parts of large item sets, Procedure for calculating the storage capacity for the hash tree after addition of the candidate item set and the rule verification item set, the storage capacity for the hash tree from the predetermined reference value When it becomes short, calculate the support level of each candidate item set and each rule verification item set, and if the candidate item set has a support level greater than a predetermined reference value, it is stored in a predetermined storage means as a large item set. Generate a correlation rule from the large item set based on the confidence level or chi-square value calculated from the saving procedure, rule validation item set and large item set support, and then delete the hash tree from the given storage means A program for executing the procedure is recorded.
[0042]
The correlation rule extracting apparatus according to the present invention includes a database that stores each item as a two-dimensional index composed of an attribute number and an attribute value, and an item that can be added to a lower level of an item that is a node of a hash tree. And a correlation rule extracting unit that generates a large item set by restricting only to items that do not have a, and extracts a correlation rule from the large item set.
[0043]
The correlation rule extraction device according to the present invention provides a database with attributes of each item as a two-dimensional index composed of attribute numbers and attribute values, or an attribute group composed of a plurality of attributes of the database. Items that do not have the same attribute number or attribute group number can be stored as a two-dimensional index composed of group numbers and attribute values of any of them, and items that can be added to the lower level of items that are nodes of the hash tree The large item set is generated by restricting to this, and the correlation rule is extracted from the large item set.
[0044]
The correlation rule extracting apparatus according to the present invention comprises data conversion means for converting each attribute value of a record stored in a database in a predetermined table format into a two-dimensional index and storing the two-dimensional index in the database. is there.
[0046]
The recording medium according to the present invention provides a computer with a procedure for reading items from a database storing each item as a two-dimensional index composed of an attribute number and an attribute value, and an item that can be added to a lower level of an item that is a hash tree node. , A program for generating a large item set by restricting only to items not having the same attribute number and executing a procedure for extracting a correlation rule from the large item set is recorded.
[0047]
The correlation rule extraction apparatus according to the present invention generates a candidate item set from a storage unit that stores a large item set and a large item set that is common to items other than the last item among the large item sets stored in the storage unit. A candidate item set generating means for calculating the support level of the candidate item set, a support level calculating means for generating a large item set having the same number of items as the candidate item set based on the support level, and storing the large item set in the storage means; The number of items in the large item set is k, and the large item set is divided into a condition part from 1 to (k-1) and a result part from (k-1) to 1 Among the rules to be generated, there is provided a correlation rule generating means that uses a rule having a certainty factor or chi-square value larger than a predetermined reference value as a correlation rule.
[0048]
The correlation rule extraction apparatus according to the present invention saves the support level of the large item set when the large item set is stored in the storage unit, and the large item set identical to the condition part of the rule is stored in the storage unit. If there is, the rule confidence or χ square value is calculated with the support of the large item set as the support of the condition part of the rule.
[0050]
The recording medium according to the present invention has one more item than the large item set from the large item set that is common to items other than the last item among the large item sets stored in the predetermined storage unit in the computer. Procedure for generating a candidate item set, calculating the support level of the candidate item set, generating a large item set with the same number of items as the candidate item set based on the support level, and storing it in a predetermined storage means, large item The number of items in the set is k, and a large item set is generated by dividing it into a condition part with the number of items from 1 to (k-1) and a result part with the number of items from (k-1) to 1. Among these rules, a program for executing a procedure in which a rule having a certainty factor or chi-square value larger than a predetermined reference value is used as an association rule is recorded.
[0051]
DETAILED DESCRIPTION OF THE INVENTION
An embodiment of the present invention will be described below.
1 is a block diagram showing a configuration of an association rule extraction apparatus according to
[0052]
Hereinafter, a large item set with the number of items k is L (k), a candidate item set with the number of items k is C (k), and a rule verification item set with the number of items k is LL ( k).
[0053]
In the large item set generation means 2, 21 refers to the record of the
[0054]
[0055]
23 reads out a large item set L (k) other than the last item from the large
[0056]
In the hypothesis generation verification means 4,
[0057]
The chi-square value is used for the chi-square test. Here, the chi-square value is calculated by the following equation as indicating the degree of relation between the rule condition part and the result part.
[Expression 1]
Here, n is the total number of records in the
[0058]
Next, the operation will be described.
FIG. 2 is a flowchart for explaining the operation of the correlation rule extracting apparatus according to the first embodiment. 3 is a diagram showing an example of the contents of the large
[0059]
First, in step ST1 of FIG. 2, the candidate item set
[0060]
Next, the initial value of the index k of the number of items is set to 2 (step ST2), hereinafter, the process of generating the large item set L (k) from the large item set L (k-1), and the generated large item set L Processing for generating an association rule from (k) will be described.
[0061]
First, in step ST3, the hash tree operation means 23 reads the large item set L (k-1) from the large
[0062]
For example, for the large item set L (3) (that is, when k = 4), [1, 2, 3], [1, 2, 4], [1, 3, 4 of the large
[0063]
Next, in step ST4, the candidate item set generation means 22 for each item in the last item set of the large item set L (k-1), and each item having a larger number than that item in the set. Thus, the branches of the above-mentioned common part are respectively extended to generate a candidate item set C (k).
[0064]
For example, in the case where the state shown in FIG. 5 is obtained after reading the large item set L (3), first, the
[0065]
When the generation of the candidate item set C (k) is completed, in step ST5, the rule
[0066]
Here, the rule verification item set LL (k−1) corresponds to the condition part of the candidate rule generated when the candidate item set C (k) becomes the large item set L (k). For example, as shown in FIG. 6, when there are two candidate item sets C (4) [2, 4, 5, 6] and [2, 4, 5, 7], the rule verification item set LL ( 3), [2, 4, 5], [2, 4, 6], [2, 5, 6], [4, 5, 6], [2, 4, 7], [2, 5, 7 ], [4, 5, 7]. Note that [2, 4, 5] overlap. That is, when the candidate item set [2, 4, 5, 6] becomes a large item set, the rules “2, 4, 5 → 6”, “2, 4, 6 → 5”, “2, 5, 6 → 4 ”,“ 4, 5, 6 → 2 ”are generated, and the candidate item set [2, 4, 5, 7] becomes a large item set, the rule“ 2, 4, 5 → 7 ” ”,“ 2, 4, 7 → 5 ”,“ 2, 5, 7 → 4 ”,“ 4, 5, 7 → 2 ”are generated, and the rule verification item set that is the condition part is generated in advance. Is done.
[0067]
The branches “2, 4, 6”, “2, 5, 6”, “4, 5” that do not exist in the hash tree in the rule verification item set LL (3) are added to the hash tree shown in FIG. , 6 "," 2, 4, 7 "," 2, 5, 7 "," 4, 5, 7 "are added as shown in FIG.
[0068]
When the processes in steps ST3 to ST5 are completed, in step ST6, the hash tree operation means 23 checks the storage capacity occupied by the hash tree in the
[0069]
If the generation of the candidate item set C (k) is not completed for the last item of all the large item sets L (k−1), the process returns to step ST4 and the next large item set L (k The process for the last item of -1) is executed in the same manner. For example, if the storage capacity occupied by the hash tree shown in FIG. 7 is less than or equal to a predetermined reference value, then in step ST4, the candidate item set for the item “6” in the array “5, 6, 7” Generation of C (k) and generation of rule verification item set LL (k-1) are executed.
[0070]
On the other hand, when the generation of the candidate item set C (k) has been completed for the last item of all the large item sets L (k−1), the hash tree operation means 23 determines that all large item sets are in step ST8. It is determined whether L (k-1) has been read and processed. If it is determined that all large item sets L (k−1) have not been processed, the process returns to step ST3, and the next group of large item sets L (k−1) is read. Processing is executed. On the other hand, when it is determined that all the large item sets L (k−1) have been processed, the process proceeds to step ST9, and the generation of the large item set L (k) is performed.
[0071]
If the storage capacity occupied by the hash tree is higher than the predetermined reference value in step ST6, the process proceeds to step ST9, where each candidate item set C (k) added to the hash tree in the
[0072]
When the large item set L (k) is generated, in step ST10, the hash tree operation means 23 then adds each rule verification item set LL (k−) added to the hash tree of the
[0073]
Next, in step ST11, the rule candidate generating means 31 first generates a rule in which each (k-1) item in the large item set L (k) is a condition part and the remaining one item is a consequent part. To do. Then, the verification value calculation means 32 obtains the certainty factor for each rule from the support level of the condition part (that is, the support level of the rule verification item set LL (k−1)) and the support level of the large item set L (k). Or the chi-square value is calculated from the support of the condition part, the support of the consequent part, the support of the large item set L (k) and the number of records in the database, and the certainty or χ2 from the predetermined reference value A rule having a high multiplier value is stored in the correlation rule set
[0074]
After generating and storing the association rule in this way, in step ST12, the hypothesis
[0075]
In step ST13, the hash tree operation means 23 reads all large item sets L (k-1) in the large
[0076]
On the other hand, when all large item sets L (k−1) in the large
[0077]
As described above, according to the first embodiment, the large item set L (k−1) is read for each item other than the last item in common, and the large item set L (k−1) is stored in the hash tree. Add a set of items that are common parts of, select any two of the last set of items in the large item set L (k-1) in turn, and add the two items to the common parts respectively The candidate item set C (k) is generated and the rule verification item set LL (k-1) is generated and added to the hash tree, and then the storage capacity for the hash tree is calculated. When the storage capacity of the candidate item set C (k) and each rule verification item set LL (k-1) is calculated, the candidate item set C (k) Of which, the degree of support is greater than a predetermined reference value Items are stored as a large item set L (k), and large items based on the certainty or χ square value calculated from the support of the rule verification item set LL (k−1) and the large item set L (k) Since the association rule is generated from the set L (k) and then the hash tree is deleted, the storage capacity used by the hash tree is checked for each large item set process, and the memory allocated in advance The effect that the capacity can be used effectively is obtained.
[0078]
The correlation rule extracting apparatus according to the second embodiment of the present invention is obtained by changing the processing for calculating the support level of the rule verification item set from that of the first embodiment. Here, only the calculation of the support level of the rule verification item set in the second embodiment will be described, and the other processes are the same as those in the first embodiment, and the description thereof will be omitted.
[0079]
In the correlation rule extracting apparatus according to the second embodiment, the support level of the rule verification item set is performed by referring to the records in the
[0080]
Then, the candidate item set verification means 21 counts the number of appearances of each candidate item set and the number of appearances of each rule verification item set in the record of the
[0081]
As described above, according to the second embodiment, since the matching of the candidate item set and the rule verification item set is executed in parallel with respect to the record read from the
[0082]
The correlation rule extracting device according to the third embodiment of the present invention is obtained by changing the processing for calculating the support level of the candidate item set from that according to the first embodiment. Here, only the calculation of the support level of the candidate item set in the first embodiment will be described, and the other processes are the same as those in the first embodiment, and the description thereof will be omitted.
[0083]
In the third embodiment, the candidate item set verification means 21 temporarily separates the subtree of the rule verification item set not related to this calculation from the hash tree when calculating the support level of the candidate item set. After completion of this calculation, the subtree is returned to the original position of the hash tree. At this time, the candidate item set verification means 21 stores the correspondence relationship between the connection node adjacent to the hash tree separation position and the node that is the root of the subtree, and after the calculation of the support level, the correspondence relationship is stored. Based on, return the subtree to its original position in the hash tree.
[0084]
FIG. 8 is a diagram illustrating an example of a position where a partial tree is cut from a hash tree. FIG. 9 is a diagram illustrating an example of a correspondence relationship between a hash tree and a separated partial tree. For example, in the hash tree shown in FIG. 8, the candidate item set is [2, 4, 5, 6], [2, 4, 5, 7], and the other branches are all branches of the rule verification set. . Therefore, nodes marked with a circle are separated from the hash tree. At this time, the number of separation positions is set as small as possible. For example, when a node is searched in order from the root in order, and the item of the node does not appear in the corresponding position of any candidate item set, the link to that node is set as the disconnection position.
[0085]
That is, in the hash tree of FIG. 8, since the item “4” does not appear in the first item of the candidate item set, the link from the root to the node of the item “4” is set as the disconnection position. Similarly, since the item “5” does not appear in the second item of the candidate item set, the link from the node of the item “2” to the node of the item “5” is set as the disconnection position, and the items “6”, “7” Does not appear in the third item of the candidate item set, the links from the node of the item “4” to the nodes of the items “6” and “7” are set as the separation positions.
[0086]
Then, as shown in FIG. 9A, the pointers to the route adjacent to the separation position and the node of the item “4” are a and d, the pointers to the node of the item “2” and the node of the item “5” are b. , C, when the pointers to the item “4” node and the item “6”, “7” node are e, f, and g, as shown in FIG. Pointers to two nodes are stored in association with each other. In this way, after storing the correspondence between the connection node adjacent to the separation position of the hash tree and the node that is the root of the subtree, the lower nodes of the root and item “2”, “4”, and “5” nodes are stored. Rewrite the link information to divide the subtree, and after the calculation of the support level, based on the correspondence (FIG. 9B), the root and items “2”, “4”, “5” nodes The link information to the node is restored and the subtree is returned to the original position of the hash tree.
[0087]
As described above, according to the third embodiment, since the subtree of the rule verification item set not related to the calculation of the support level of the candidate item set is separated from the hash tree, the support level of the candidate item set The matching is not performed for the rule verification item set that is not related to the calculation, and the matching of the candidate item set can be performed efficiently.
[0088]
The correlation rule extracting device according to the fourth embodiment of the present invention stores data indicating the correspondence between the connection node of the hash tree and the root of the subtree of the rule verification item set according to the data structure of the stack, and stores the data in the data. Based on this, the separated subtree is returned to the original position of the hash tree. Since other processes are the same as those in the third embodiment, description thereof is omitted.
[0089]
In the fourth embodiment, the candidate item set verification means 21 displays the correspondence relationship between the connection node adjacent to the separation position of the hash tree and the node that is the root of the subtree in the stack area having a certain storage capacity. The data is sequentially stored in accordance with the data structure of the stack, and after the calculation of the support degree is completed, the corresponding relationship is sequentially read from the stack, and the subtree is returned to the original position of the hash tree.
[0090]
FIG. 10 is a diagram illustrating an example of a stack that stores the correspondence between the hash tree and the separated subtree. For example, when the partial tree of the rule verification item set is separated from the hash tree of FIG. 8, pointers to two nodes adjacent to the separation position are associated and stored in the stack as shown in FIG. After the calculation of is finished, the subtree is read from the stack in reverse order, and the subtree is returned to the original position.
[0091]
As described above, according to the fourth embodiment, in addition to the effects of the third embodiment, the data indicating the correspondence between the connection node of the hash tree and the root of the subtree of the rule verification item set is represented by the stack. Since the data is stored in accordance with the data structure, the memory management can be simplified.
[0092]
The correlation rule extracting device according to the fifth embodiment of the present invention stores data indicating the correspondence between the connection node of the hash tree and the root of the subtree of the rule verification item set according to the data structure of the list, and stores the data in the data Based on this, the separated subtree is returned to the original position of the hash tree. Since other processes are the same as those in the third embodiment, description thereof is omitted.
[0093]
In the fifth embodiment, the candidate item set
[0094]
FIG. 11 is a diagram illustrating an example of a list that stores correspondence relationships between hash trees and separated subtrees. For example, when the subtree of the rule verification item set is separated from the hash tree of FIG. 8, as shown in FIG. 11 (b), the roots of the separated subtrees are shown as a series of lists as shown in FIG. 11 (b). In addition, records associated with pointers to two nodes adjacent to the separation position are stored as a list, and after the calculation of support is completed, each record is sequentially read from the list, and the subtree is returned to the original position. Returned.
[0095]
As described above, according to the fifth embodiment, in addition to the effects of the third embodiment, data indicating the correspondence between the connection node of the hash tree and the root of the subtree of the rule verification item set is represented by a list. Since the data is stored in accordance with the data structure, the number of separation positions may be any number, and it is not necessary to secure an unnecessary storage area in advance, so that the memory can be used efficiently.
[0096]
When the storage capacity for the hash tree becomes larger than a predetermined reference value, the correlation rule extraction device according to
[0097]
In the sixth embodiment, the hash tree operation means 23 calculates the storage capacity for the hash tree after adding the common part of the read large item set, the candidate item set, and the rule verification item set. If the storage capacity for the large item set is larger than a predetermined reference value, the common part of these large item sets, the candidate item set, and the subtree corresponding to the rule verification item set are deleted from the hash tree.
[0098]
Thereafter, the candidate item set verification means 21 calculates the support level of the remaining candidate item sets and rule verification item sets. The large item set deleted at this time is read and processed again after the hash tree is deleted.
[0099]
As described above, according to the sixth embodiment, when the storage capacity for the hash tree becomes larger than the predetermined reference value, the common part of the large item set added immediately before, the candidate item set, and the rule verification Since the item set is deleted from the hash tree and the storage capacity for the hash tree is restored to a state where it is less than or equal to the predetermined reference value, the calculation of support is performed, so the storage capacity used is more accurate. The effect that it can restrict | limit to is acquired.
[0100]
In the correlation rule extracting device according to the seventh embodiment of the present invention, the maximum value of the increase in the storage capacity for the hash tree by adding the common part of the large item set, the candidate item set, and the rule verification item set is predetermined. When the remaining storage area becomes larger than the remaining storage area, a large item set and a correlation rule are generated, and thereafter a process of deleting the hash tree is executed. Since other processes are the same as those in the first embodiment, description thereof is omitted.
[0101]
In the seventh embodiment, the hash
[0102]
As described above, according to the seventh embodiment, the maximum value of the increase in the storage capacity for the hash tree due to the addition of the common part of the large item set, the candidate item set, and the rule verification item set is predetermined. When the remaining storage area exceeds the remaining capacity of the storage area, a large item set and a correlation rule are generated, and then the hash tree is deleted. The effect is obtained that the memory is effectively used up to the point before the value is exceeded.
[0103]
Embodiment 8 FIG.
In the correlation rule extraction device according to the eighth embodiment of the present invention, the average value of the increase in the storage capacity for the hash tree by adding the common part of the large item set, the candidate item set, and the rule verification item set is stored in a predetermined amount. When the area becomes larger than the remaining capacity, a large item set and a correlation rule are generated, and then a process for deleting the hash tree is executed. Since other processes are the same as those in the first embodiment, description thereof is omitted.
[0104]
In the eighth embodiment, the hash tree operation means 23 adds the common part of the large item set, the candidate item set, and the rule verification item set LL (k−1) to the hash tree, The storage capacity is calculated, and the difference between the calculation result and the previous calculation result is calculated to calculate the increase in the storage capacity for the hash tree. Next, the hash tree operation means 23 calculates the average value of the increase amount up to this time based on the increase amount, the average value of the increase amount up to the previous time, and the number of additions. The hash tree operation means 23 calculates the remaining capacity of the storage capacity, which is the difference between the predetermined reference value and the storage capacity for the hash tree calculated this time, and if the above average value is larger than the remaining capacity, Then, a large item set and a correlation rule are generated, and then a process of deleting the hash tree is executed. If not, the next large item set is read and processed.
[0105]
As described above, according to the eighth embodiment, the average value of the increase in the storage capacity for the hash tree due to the addition of the common part of the large item set, the candidate item set, and the rule verification item set is stored in the predetermined memory. Since the large item set and the correlation rule are generated and the processing for deleting the hash tree is executed after that when the remaining area becomes larger than the remaining capacity of the area, the storage capacity for the hash tree is set to a predetermined reference value. The effect is obtained that the memory is effectively used up to the point before it exceeds.
[0106]
Embodiment 9 FIG.
FIG. 12 is a block diagram showing a configuration of an association rule extraction apparatus according to Embodiment 9 of the present invention. In the figure, 1A is a database that stores a plurality of records in a table format and stores receipt format data. Here, the receipt format is a continuous representation of items for each attribute value in the records of the
[0107]
51 reads a record in the receipt format of the
[0108]
In the correlation
[0109]
Since the other components in the correlation
[0110]
Next, the operation will be described.
FIG. 13 is a diagram illustrating an example of a table format, FIG. 14 is a diagram illustrating an example of a record stored in the
[0111]
First, the receipt file generation means 52 reads out a record stored in, for example, a table format as shown in FIG. 13, and corresponds to an attribute number assigned to each attribute of the table and the attribute number in the read record. Data in a two-dimensional index format (attribute number | attribute value) composed of a number (attribute value) assigned corresponding to the attribute to be generated is generated for each attribute value of the record and stored in the
[0112]
Next, the large item set generation means 2A of the correlation
[0113]
However, when the hash
[0114]
By doing so, the items that can be added under the item that is the node of the hash tree are limited to items that do not have the same attribute number, so an item set consisting of attribute values in the same attribute is generated Not.
[0115]
Then, the hypothesis
[0116]
As described above, according to the ninth embodiment, each item is stored in the database as a two-dimensional index composed of an attribute number and an attribute value, and items that can be added under the item that is a node of the hash tree are Since a large item set is generated by restricting to items that do not have the same attribute number, generation of attribute value correlation rules for the same attribute can be suppressed, and generation of negative correlation rules can be suppressed. The effect that it can be obtained.
[0117]
In the ninth embodiment, the receipt file generation means 52 converts the data format recorded in the
[0118]
In the ninth embodiment, the correlation
[0119]
The correlation rule extracting apparatus according to the tenth embodiment of the present invention is capable of designating a plurality of attributes that do not generate correlation rules with each other in the correlation rule extracting apparatus according to the ninth embodiment. Since other processes are the same as those in the ninth embodiment, the description thereof is omitted.
[0120]
In the tenth embodiment, a plurality of attributes that do not generate correlation rules are defined as attribute groups, and the attribute values of the attribute groups are converted into items of (attribute group number | attribute value). For example, the attribute “
[0121]
Then, when executing branch extension of the hash tree, the following rules are followed as in the ninth embodiment, and items that do not follow the following rules are not added to the hash tree.
[0122]
As described above, according to the tenth embodiment, in addition to the effects of the ninth embodiment, the same attribute group number is used for items corresponding to attributes that do not generate correlation rules with each other. As a result, the generation of a correlation rule can be suppressed, and post-processing for removing such a correlation rule can be omitted.
[0123]
In the correlation rule extracting device according to the eleventh embodiment of the present invention, when the number of items in the large item set is k, the condition item for the large item set from 1 to (k−1) and the number of items are (k Among the rules generated by dividing each of the -1) to 1 consequent parts, a rule having a certainty factor or chi-square value larger than a predetermined reference value is used as a correlation rule.
[0124]
In the eleventh embodiment, for all integers Nc where (k−1) ≧ Nc ≧ 1, the rule that the number of items in the condition part is Nc and the number of items in the result part is (k−Nc) is large. Generated from the item set L (k).
[0125]
For example, from the large item set “2, 4, 5, 6”, the rules “2, 4, 5 → 6”, “2, 4, 6 → 5”, “2, 5, 6 → 4”, “4, 5,6 → 2 ”, rules“ 2,4 → 5,6 ”,“ 2,5 → 4,6 ”,“ 2,6 → 4,5 ”,“ 4,5 → 2,6 ”,“ 4 , 6 → 2, 5 ”,“ 5, 6 → 2, 4 ”and rules“ 2 → 4, 5, 6 ”,“ 4 → 2, 5, 6 ”,“ 5 → 2, 4, 6 ”,“ 6 → 2, 4, 5 ”is generated. Similarly, from the large item set “2, 4, 5, 7”, the rules “2, 4, 5 → 7”, “2, 4, 7 → 5”, “2, 5, 7 → 4”, “4” , 5, 7 → 2 ”, rules“ 2,4 → 5,7 ”,“ 2,5 → 4,7 ”,“ 2,7 → 4,5 ”,“ 4,5 → 2,7 ”,“ 4,7 → 2,5 ”,“ 5,7 → 2,4 ”and rules“ 2 → 4,5,7 ”,“ 4 → 2,5,7 ”,“ 5 → 2,4,7 ”, “7 → 2, 4, 5” is generated.
[0126]
FIG. 16 shows an example of a hash tree value to which rule verification item sets LL (1) to LL (k−1) generated when the number of items in the condition part of the rule is 1 to (k−1). FIG. For example, when generating a large item set as in the first embodiment, rule verification item sets LL (1) to LL (k−1) corresponding to the condition part of this rule are hashed as shown in FIG. Added to the tree.
[0127]
Then, for each generated rule, a certainty factor or chi-square value is calculated, and a rule having a certainty factor or chi-square value higher than a predetermined reference value is stored as an association rule.
[0128]
In addition, when calculating the certainty factor or the chi-square value, it is necessary to support the condition part of the rule whose number of items is 1 to (k−1). For example, as in the first embodiment, a large item set is selected. In the case of generation, the generated large item sets L (1) to L (k−1) are stored without being deleted from the large
[0129]
For example, in the hash tree shown in FIG. 16, the rule verification item set LL (i) (i = 1 to (k−1)) corresponding to the condition part of the rule is stored in association with it.
[0130]
As described above, according to the eleventh embodiment, when creating a correlation rule candidate from a large item set with k items, the number of items in the condition part is 1 to (k−1). Since the candidate rules having the number of items in the consequence part of (k-1) to 1 are respectively generated, the effect that the outcome part can generate two or more correlation rules can be obtained.
[0131]
Furthermore, since the generated large item sets L (1) to L (k-1) are stored and used as the support degree of the condition part of the rule, the consequent part generates two or more correlation rules. Even in this case, it is possible to easily calculate the certainty factor or the chi-square value.
[0132]
The procedure for generating a large item set in the correlation rule extracting apparatus according to the eleventh embodiment is not limited to that according to the first to tenth embodiments, but the large item set is stored in a file. It is effective for any algorithm to be managed.
[0133]
FIG. 17 is a block diagram showing a configuration of an association rule extraction apparatus according to
[0134]
In the figure,
[0135]
[0136]
Next, the operation will be described.
First, the
[0137]
As described above, according to the twelfth embodiment, since the program describing the processing procedure according to the first to eleventh embodiments is executed on the computer, the various processes described above are executed. The same effects as those of the first to eleventh embodiments are obtained.
[0138]
【The invention's effect】
As described above, according to the present invention, the large item set is read from the predetermined storage unit for each common item other than the last item, and the large item set is stored in the hash tree stored in the predetermined storage unit. Add an item set that is a common part, select any two of the last set of items in the large item set that you have read out, and add the two items to the common part respectively. Generate and add an item set that is a part of each candidate item set and has one item less than the candidate item set to the hash tree as a rule verification item set, and common parts of the large item set, candidate item sets and rules The storage capacity for the hash tree after the addition of the verification item set is calculated, and when the storage capacity for the hash tree becomes larger than a predetermined reference value, each candidate item set and The support level of each rule verification item set is calculated, and among the candidate item sets, those whose support level is greater than a predetermined reference value are stored as a large item set in a predetermined storage means, and the rule verification item set and the large item are stored. Since the association rule is generated from the large item set based on the certainty factor or the chi-square value calculated from the support of the set, and then the hash tree is deleted from the predetermined storage means, each large item set The storage capacity used by the hash tree is checked for each process, and there is an effect that the storage capacity allocated in advance can be used effectively.
[0139]
According to the present invention, the support level is stored in the storage unit together with the large item set, and when the same large item set as each rule verification item set is stored in the storage unit, the support of the large item set is supported. Since the degree is set as the support level of the rule verification item set, when there are few large item sets, the support level of each rule verification item set can be obtained in a short time. .
[0140]
According to this invention, a record is read from the database, and the number of appearances of the candidate item set and the number of occurrences of the rule verification item set are counted in parallel to determine the support level of the candidate item set and the support level of the rule verification item set. Since it is configured to calculate, when there are many large item sets, it is possible to calculate the support level of each rule verification item set in a shorter time than searching the large item set stored in the storage means There is.
[0141]
According to this invention, after separating the partial tree corresponding to the rule verification item set from the hash tree, the support level of each candidate item set is calculated, and after the support level is calculated, the part corresponding to the rule verification item set is calculated. Since the tree is configured to return to the original position of the hash tree, matching is not performed for the rule verification item set that is not related to the calculation of the support level of the candidate item set, and the candidate item set is efficiently matched There is an effect that can be done.
[0142]
According to the present invention, the data indicating the correspondence between the connection node of the hash tree to which the separated subtree is connected and the root of the subtree is stored according to the data structure of the stack, and the data is separated based on the data. Since the partial tree is returned to the original position of the hash tree, the memory management can be simplified.
[0143]
According to this invention, the data indicating the correspondence between the connection node of the hash tree to which the separated subtree is connected and the root of the subtree is stored according to the data structure of the list, and the data is separated based on the data Since the configuration is such that the subtree is returned to the original position of the hash tree, the number of separation positions is not limited, and there is no need to reserve an unnecessary storage area in advance, and the memory can be used efficiently. is there.
[0144]
According to the present invention, when the storage capacity for the hash tree becomes larger than a predetermined reference value, the common part of the large item set, the candidate item set, and the rule verification item set that are added immediately before are stored from the hash tree. Since the deletion is configured, there is an effect that the used storage capacity can be more accurately limited.
[0145]
According to the present invention, the maximum value of the increase in the storage capacity for the hash tree due to the addition of the common part of the large item set, the candidate item set, and the rule verification item set is the predetermined reference value and the hash tree. Since the support level is calculated, the association rule is generated, and the hash tree is erased after that, the storage capacity for the hash tree is set to a predetermined standard. There is an effect that the memory is used effectively before the value is exceeded.
[0146]
According to the present invention, the average value of the increase in the storage capacity for the hash tree due to the addition of the common part of the large item set, the candidate item set, and the rule verification item set is calculated for the predetermined reference value and the hash tree. Since the support degree is calculated when the difference from the storage capacity becomes larger, the association rule is generated, and then the hash tree is erased, the storage capacity for the hash tree has a predetermined reference value. There is an effect that the memory is effectively used up to the front.
[0147]
According to this invention, each item is stored in the database as a two-dimensional index composed of an attribute number and an attribute value, and an item that can be added to a lower level of an item that is a node of a hash tree does not have the same attribute number It is configured to generate a large item set and extract a correlation rule from the large item set, so it is possible to suppress the generation of correlation rules for attribute values in the same attribute, and the negative correlation rule There is an effect that generation can be suppressed.
[0148]
According to this invention, the value of each item is stored in the database as a two-dimensional index composed of attribute numbers and attribute values, or attribute group numbers for attribute groups composed of a plurality of attributes of the database and those It is saved as a two-dimensional index consisting of any one of the attribute values, and the items that can be added to the lower level of items that are nodes of the hash tree are limited to items that do not have the same attribute number or attribute group number. Since a large item set is generated and correlation rules are extracted from the large item set, generation of unnecessary correlation rules can be suppressed, and post-processing for removing such correlation rules is omitted. There is an effect that can be.
[0149]
According to this invention, the data conversion means for converting each attribute value of the record stored in advance in the database in a predetermined table format into a two-dimensional index and storing the two-dimensional index in the database is provided. Even if records are recorded in tabular form, they are converted to a two-dimensional index, and similarly, generation of correlation rules for attribute values in the same attribute can be suppressed, and generation of negative correlation rules can be suppressed. There is an effect.
[0150]
According to the present invention, a candidate item set whose number of items is one more than the large item set is generated from the large item set that is common to the items other than the last item among the large item sets stored in the predetermined storage unit. And calculating the degree of support of the candidate item set, generating a large item set having the same number of items as the candidate item set based on the degree of support, and storing it in the storage means; The certainty factor among the rules generated by dividing the large item set into a condition part with the number of items from 1 to (k-1) and a result part with the number of items from (k-1) to 1 Alternatively, since the correlation rule is such that the χ square value is larger than the predetermined reference value, there is an effect that the consequent part can generate two or more correlation rules.
[0151]
According to this invention, when the large item set is stored in the storage unit, the support level of the large item set is also stored, and when the same large item set as the condition part of the rule is stored in the storage unit Since the rule confidence level or chi-square value is calculated using the support level of the large item set as the support level of the condition part of the rule, it is easy for the consequent part to generate two or more correlation rules. There is an effect that the certainty factor or the chi-square value can be calculated.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an association rule extraction device according to
FIG. 2 is a flowchart for explaining the operation of the correlation rule extraction device according to the first embodiment.
FIG. 3 is a diagram showing an example of contents of a large item set file.
4 is a diagram showing a hash tree composed of the large item sets [1, 2, 3], [1, 2, 4], [1, 3, 5], [1, 4, 5] in FIG. 3; It is.
FIG. 5 is a diagram illustrating an example of an operation in step ST3 of FIG.
6 is a diagram illustrating an example of an operation in step ST4 of FIG.
FIG. 7 is a diagram for explaining an example of an operation in step ST5 of FIG.
FIG. 8 is a diagram illustrating an example of a position where a partial tree is cut from a hash tree.
FIG. 9 is a diagram illustrating an example of a correspondence relationship between a hash tree and a separated subtree.
FIG. 10 is a diagram illustrating an example of a stack that stores a correspondence relationship between a hash tree and a separated subtree.
FIG. 11 is a diagram illustrating an example of a list storing a correspondence relationship between a hash tree and a separated subtree.
FIG. 12 is a block diagram showing a configuration of an association rule extraction device according to Embodiment 9 of the present invention.
FIG. 13 is a diagram showing an example of a table format.
FIG. 14 is a diagram showing an example of a record stored in a database in a receipt format.
FIG. 15 is a diagram illustrating an example of a hash tree including receipt format items.
FIG. 16 is an example of a hash tree value to which rule verification item sets LL (1) to LL (k−1) are generated when the number of items in the rule condition part is 1 to (k−1). FIG.
FIG. 17 is a block diagram showing a configuration of an association rule extraction device according to
FIG. 18 is a block diagram showing a configuration example of a conventional correlation rule extraction device.
FIG. 19 is a diagram illustrating an example of a hash tree indicating a large item set.
FIG. 20 is a diagram for explaining the previously proposed first technique.
FIG. 21 is a diagram for explaining the previously proposed second technique.
[Explanation of symbols]
1, 1A database, 3 large item set files (storage means), 4 hypothesis generation verification means (association rule generation means), 6 memory (storage means), 21 candidate item set verification means (support level calculation means), 22 candidate items Set generation means (candidate item set generation means, rule verification item set generation means), 23 hash tree operation means (common item set addition means, storage capacity calculation means), 51 correlation rule extraction unit, 52 receipt file generation means (data Conversion means), 71 CPU (correlation rule generation means, support level calculation means, candidate item set generation means, rule verification item set generation means, common item set addition means, storage capacity calculation means, correlation rule extraction unit, data conversion means ), 73 RAM (storage means), 81A program, 91 recording medium.
Claims (17)
各品目をノードとするハッシュ木として複数の品目セットを記憶する記憶手段と、
大品目セットを保存する保存手段と、
前記保存手段から前記大品目セットを、最後の品目以外の品目が共通するもの毎に読み出し、その共通部分である品目セットを前記ハッシュ木に追加する共通品目セット追加手段と、
読み出された前記大品目セットの最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ前記共通部分に追加して前記大品目セットより1だけ品目数の多い候補品目セットを生成する候補品目セット生成手段と、
各候補品目セットの一部であってその候補品目セットより品目数が1だけ少ない品目セットをルール検証用品目セットとして前記ハッシュ木に追加するルール検証用品目セット生成手段と、
前記大品目セットの共通部分、前記候補品目セットおよび前記ルール検証用品目セットの追加後の前記ハッシュ木のための記憶容量を計算する記憶容量計算手段と、
前記記憶容量計算手段により計算された前記ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットおよび各ルール検証用品目セットの支持度を計算し、前記候補品目セットのうち、前記支持度が所定の基準値より大きいものを大品目セットとして前記保存手段に保存する支持度計算手段と、
前記記憶容量計算手段により計算された前記ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、前記ルール検証用品目セットおよび前記大品目セットの支持度より計算される確信度またはχ2乗値に基づいて前記大品目セットから相関ルールを生成し、その後に前記ハッシュ木を前記記憶手段から消去する相関ルール生成手段と
を備えることを特徴とする相関ルール抽出装置。In a correlation rule extraction device that extracts a correlation rule between item sets of a database from a plurality of records recorded in the database,
Storage means for storing a plurality of item sets as a hash tree with each item as a node;
A storage means for storing large item sets;
A common item set adding unit that reads the large item set from the storage unit for each item other than the last item in common, and adds an item set that is a common part to the hash tree;
Select any two of the last set of items of the read large item set in order, and add the two items to the common part, respectively, and add one item from the large item set. Candidate item set generation means for generating a large number of candidate item sets;
A rule verification item set generation means for adding an item set that is a part of each candidate item set and has one item less than the candidate item set to the hash tree as a rule verification item set;
A storage capacity calculating means for calculating a storage capacity for the hash tree after addition of the common part of the large item set, the candidate item set, and the rule verification item set;
When the storage capacity for the hash tree calculated by the storage capacity calculation means is greater than a predetermined reference value, the support level of each candidate item set and each rule verification item set is calculated, and the candidate item Of the set, the support degree calculation means for storing the support degree larger than a predetermined reference value as a large item set in the storage means,
When the storage capacity for the hash tree calculated by the storage capacity calculation means becomes larger than a predetermined reference value, the certainty factor calculated from the support level of the rule verification item set and the large item set or An association rule extraction device comprising: an association rule generation unit that generates an association rule from the large item set based on a chi-square value and then deletes the hash tree from the storage unit.
ことを特徴とする請求項1記載の相関ルール抽出装置。The support degree calculation means stores the support degree together with the large item set in the storage means. When the same large item set as each rule verification item set is stored in the storage means, the large item set is stored in the storage means. The correlation rule extraction device according to claim 1, wherein the support level is a support level of the rule verification item set.
ことを特徴とする請求項1記載の相関ルール抽出装置。The support level calculation means reads a record from the database, counts the number of appearances of the candidate item set and the number of occurrences of the rule verification item set in parallel, and supports the support level of the candidate item set and the rule verification item set. The correlation rule extracting device according to claim 1, wherein the degree is calculated.
ことを特徴とする請求項1記載の相関ルール抽出装置。The support level calculation means, after separating the subtree corresponding to the rule verification item set from the hash tree, calculates the support level of each candidate item set, and after the support level calculation, corresponds to the rule verification item set The correlation rule extraction device according to claim 1, wherein the subtree to be returned is returned to the original position of the hash tree.
ことを特徴とする請求項4記載の相関ルール抽出装置。The support degree calculation means stores data indicating the correspondence relationship between the connection node of the hash tree to which the separated subtree is connected and the root of the subtree in accordance with the data structure of the stack, and separates based on the data The correlation rule extraction device according to claim 4, wherein the subtree is returned to the original position of the hash tree.
ことを特徴とする請求項4記載の相関ルール抽出装置。The support degree calculation means stores data indicating the correspondence relationship between the connection node of the hash tree to which the separated subtree is connected and the root of the subtree according to the data structure of the list, and separates based on the data The correlation rule extraction device according to claim 4, wherein the subtree is returned to the original position of the hash tree.
ことを特徴とする請求項1記載の相関ルール抽出装置。When the storage capacity for the hash tree becomes larger than a predetermined reference value, the storage capacity calculating means stores the common part, candidate item set, and rule verification item set of the large item set added immediately before the hash tree. The correlation rule extracting device according to claim 1, wherein the correlation rule extracting device is deleted from the correlation rule extracting device.
ことを特徴とする請求項1記載の相関ルール抽出装置。The support degree calculation means and the correlation rule generation means add a common part of a large item set, a candidate item set, and a rule verification item set instead of the case where the storage capacity for the hash tree becomes larger than a predetermined reference value. When the maximum value of the amount of increase in the storage capacity for the hash tree according to is greater than the difference between the predetermined reference value and the storage capacity for the hash tree, the support level is calculated, and the correlation rule The correlation rule extracting apparatus according to claim 1, wherein the hash tree is deleted after that.
ことを特徴とする請求項1記載の相関ルール抽出装置。The support degree calculation means and the correlation rule generation means add a common part of a large item set, a candidate item set, and a rule verification item set instead of the case where the storage capacity for the hash tree becomes larger than a predetermined reference value. If the average value of the increase in storage capacity for the hash tree due to is greater than the difference between the predetermined reference value and the storage capacity for the hash tree, the support level is calculated and an association rule is generated. Then, the hash tree is deleted after that. The correlation rule extraction device according to claim 1, wherein:
コンピュータに、
所定の保存手段から大品目セットを、最後の品目以外の品目が共通するもの毎に読み出し、所定の記憶手段に記憶され各品目をノードとした品目セットのハッシュ木に、前記大品目セットの共通部分である品目セットを追加する手順、
読み出した前記大品目セットの最後の品目の集合のうちのいずれか2つを順番に選択し、その2つの品目をそれぞれ前記共通部分に追加して、前記大品目セットより品目数が1だけ多い候補品目セットを生成する手順、
各候補品目セットの一部であって前記候補品目セットより品目数が1だけ少ない品目セットをルール検証用品目セットとして前記ハッシュ木に追加する手順、
前記大品目セットの共通部分、前記候補品目セットおよび前記ルール検証用品目セットの追加後の前記ハッシュ木のための記憶容量を計算する手順、
前記ハッシュ木のための記憶容量が所定の基準値より大きくなった場合に、各候補品目セットおよび各ルール検証用品目セットの支持度を計算し、前記候補品目セットのうち、前記支持度が所定の基準値より大きいものを大品目セットとして前記所定の保存手段に保存する手順、
前記ルール検証用品目セットおよび前記大品目セットの支持度より計算される確信度またはχ2乗値に基づいて前記大品目セットから相関ルールを生成し、その後に前記ハッシュ木を前記所定の記憶手段から消去する手順
を実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。In a computer-readable recording medium recording a program for causing a computer to extract a correlation rule between item sets of a database from a plurality of records recorded in the database,
On the computer,
A large item set is read from a predetermined storage unit for each item other than the last item in common, and the large item set is stored in a predetermined storage unit and stored in a predetermined storage unit as a node in the item set hash tree. To add item sets that are part,
Select any two of the last set of items in the large item set that has been read out, add the two items to the common part, and have one more item than the large item set Steps to generate a candidate item set,
A step of adding an item set that is a part of each candidate item set and has one item less than the candidate item set to the hash tree as a rule verification item set;
Calculating storage capacity for the hash tree after addition of the common part of the large item set, the candidate item set and the rule validation item set;
When the storage capacity for the hash tree becomes larger than a predetermined reference value, the support level of each candidate item set and each rule verification item set is calculated, and the support level of the candidate item set is predetermined. A procedure for storing a larger item set in the predetermined storage means as a large item set,
A correlation rule is generated from the large item set based on a certainty factor or a chi-square value calculated from the support level of the rule verification item set and the large item set, and then the hash tree is stored from the predetermined storage unit. A computer-readable recording medium having recorded thereon a program for executing the erasing procedure.
属性番号と属性値で構成される2次元インデックスとして各品目を保存するデータベースと、
前記ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出する相関ルール抽出部と
を備えることを特徴とする相関ルール抽出装置。Store the item set as a hash tree with each item corresponding to each attribute of the database as a node, and add a node corresponding to the item to the hash tree according to a predetermined rule from multiple records recorded in the database In the correlation rule extraction device that generates a set and extracts a correlation rule between attributes of the database,
A database that stores each item as a two-dimensional index composed of attribute numbers and attribute values;
A correlation rule extraction unit that generates a large item set by limiting the items that can be added to the lower level of the item that is a node of the hash tree to only items that do not have the same attribute number, and extracts a correlation rule from the large item set An association rule extraction device comprising:
相関ルール抽出部は、ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号または属性グループ番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出する
ことを特徴とする請求項11記載の相関ルール抽出装置。The database sets the value of each item as a two-dimensional index composed of an attribute number and an attribute value, or an attribute group number for an attribute group composed of a plurality of attributes of the database and one of them. Save as a two-dimensional index consisting of attribute values,
The correlation rule extraction unit generates a large item set by limiting the items that can be added below the item that is the node of the hash tree to only items that do not have the same attribute number or attribute group number, and generates a large item set from the large item set. The correlation rule extracting device according to claim 11 , wherein the correlation rule is extracted.
ことを特徴とする請求項11記載の相関ルール抽出装置。The correlation according to claim 11 , further comprising data conversion means for converting each attribute value of a record previously stored in a database in a predetermined table format into a two-dimensional index and storing the two-dimensional index in the database. Rule extraction device.
コンピュータに、
属性番号と属性値で構成される2次元インデックスとして各品目を保存する前記データベースから品目を読み出す手順、
前記ハッシュ木のノードである品目の下位に追加できる品目を、同一の属性番号を有しない品目だけに制限して大品目セットを生成し、その大品目セットから相関ルールを抽出する手順
を実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。The computer stores the item set as a hash tree with each item corresponding to each attribute of the database as a node, and adds a node corresponding to the item to the hash tree according to a predetermined rule from a plurality of records recorded in the database In a computer-readable recording medium recording a program for generating a large item set and extracting a correlation rule between attributes of the database,
On the computer,
A procedure for reading items from the database that stores each item as a two-dimensional index composed of an attribute number and an attribute value;
Generate a large item set by limiting the items that can be added to the lower level of the item that is a node of the hash tree to only items that do not have the same attribute number, and execute a procedure for extracting a correlation rule from the large item set A computer-readable recording medium on which a program for recording is recorded.
大品目セットを保存する保存手段と、
前記保存手段に保存された大品目セットのうち、最後の品目以外の品目が共通する前記大品目セットから、その大品目セットより品目数が1だけ多い候補品目セットを生成する候補品目セット生成手段と、
前記候補品目セットの支持度を計算し、その支持度に基づいて前記候補品目セットと同一品目数の大品目セットを生成して前記保存手段に保存する支持度計算手段と、
前記大品目セットの品目数をkとして、前記大品目セットを、品目数が1から(k−1)までの条件部と品目数が(k−1)から1までの帰結部とに分割してそれぞれ生成されるルールのうち、確信度またはχ2乗値が所定の基準値より大きいものを相関ルールとする相関ルール生成手段と
を備えることを特徴とする相関ルール抽出装置。In a correlation rule extraction device that extracts a correlation rule between item sets of a database from a plurality of records recorded in the database,
A storage means for storing large item sets;
Candidate item set generation means for generating a candidate item set having a larger number of items than the large item set by one from the large item set that is common to items other than the last item among the large item sets stored in the storage unit When,
A support degree calculating means for calculating a support degree of the candidate item set, generating a large item set having the same number of items as the candidate item set based on the support degree, and storing the large item set in the storage means;
The number of items in the large item set is k, and the large item set is divided into a condition part with the number of items from 1 to (k-1) and a consequent part with the number of items from (k-1) to 1. And a correlation rule generation unit that uses a rule having a certainty factor or chi-square value greater than a predetermined reference value as a correlation rule.
支持度計算手段は、大品目セットを前記保存手段に保存する際に、その大品目セットの支持度も保存し、ルールの条件部と同一の大品目セットが前記保存手段に保存されている場合には、その大品目セットの支持度をそのルールの条件部の支持度として前記ルールの確信度またはχ2乗値を計算する
ことを特徴とする請求項15記載の相関ルール抽出装置。The storage means stores the support level together with the large item set,
When the support level calculation unit stores the large item set in the storage unit, the support level calculation unit also stores the support level of the large item set, and the same large item set as the condition part of the rule is stored in the storage unit. The correlation rule extraction device according to claim 15 , wherein the certainty factor or χ square value of the rule is calculated using the support level of the large item set as the support level of the condition part of the rule.
コンピュータに、
所定の保存手段に保存された大品目セットのうち、最後の品目以外の品目が共通する大品目セットから、その大品目セットより品目数が1だけ多い候補品目セットを生成する手順、
前記候補品目セットの支持度を計算し、その支持度に基づいて前記候補品目セットと同一品目数の大品目セットを生成して前記所定の保存手段に保存する手順、
前記大品目セットの品目数をkとして、前記大品目セットを、品目数が1から(k−1)までの条件部と品目数が(k−1)から1までの帰結部とに分割してそれぞれ生成されるルールのうち、確信度またはχ2乗値が所定の基準値より大きいものを相関ルールとする手順
を実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。In a computer-readable recording medium recording a program for causing a computer to extract a correlation rule between item sets of a database from a plurality of records recorded in the database,
On the computer,
A procedure for generating a candidate item set having one item larger than the large item set from the large item set having items other than the last item among the large item sets stored in the predetermined storage unit,
Calculating a support level of the candidate item set, generating a large item set having the same number of items as the candidate item set based on the support level, and storing the large item set in the predetermined storage unit;
The number of items in the large item set is k, and the large item set is divided into a condition part with the number of items from 1 to (k-1) and a consequent part with the number of items from (k-1) to 1. A computer-readable recording medium having recorded thereon a program for executing a procedure in which a rule having a certainty factor or chi-square value greater than a predetermined reference value is used as a correlation rule.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP05737599A JP3810575B2 (en) | 1999-03-04 | 1999-03-04 | Association rule extraction apparatus and recording medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP05737599A JP3810575B2 (en) | 1999-03-04 | 1999-03-04 | Association rule extraction apparatus and recording medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000259611A JP2000259611A (en) | 2000-09-22 |
| JP3810575B2 true JP3810575B2 (en) | 2006-08-16 |
Family
ID=13053861
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP05737599A Expired - Fee Related JP3810575B2 (en) | 1999-03-04 | 1999-03-04 | Association rule extraction apparatus and recording medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3810575B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7404080B2 (en) | 2001-04-16 | 2008-07-22 | Bjorn Markus Jakobsson | Methods and apparatus for efficient computation of one-way chains in cryptographic applications |
-
1999
- 1999-03-04 JP JP05737599A patent/JP3810575B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000259611A (en) | 2000-09-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20130151562A1 (en) | Method of calculating feature-amount of digital sequence, and apparatus for calculating feature-amount of digital sequence | |
| CN109684333B (en) | Data storage and cutting method, equipment and storage medium | |
| CN114840487B (en) | Metadata management method and device for distributed file system | |
| EP2945071B1 (en) | Index generating device and method, and search device and search method | |
| JPH10504407A (en) | Method and memory structure for storing and retrieving data | |
| CN105320775A (en) | Data access method and apparatus | |
| KR20130020050A (en) | Apparatus and method for managing bucket range of locality sensitivie hash | |
| US6735600B1 (en) | Editing protocol for flexible search engines | |
| CN108399213A (en) | A kind of clustering method and system of user oriented personal document | |
| JP4745419B2 (en) | Document classification apparatus and program | |
| AU740957B2 (en) | File processing method, data processing apparatus and storage medium | |
| JP5790755B2 (en) | Database management apparatus and database management method | |
| JP6973137B2 (en) | Generation program, generation method and generation device | |
| CN111984732B (en) | Methods, nodes and blockchain networks to implement decentralized retrieval on the blockchain | |
| CN117763077A (en) | Data query method and device | |
| JPH09204310A (en) | Judgment rule correction device and judgment rule correction method | |
| JP3810575B2 (en) | Association rule extraction apparatus and recording medium | |
| CN112531709B (en) | Power grid topology configuration method | |
| CN118445264B (en) | Electronic filing data storage method and system | |
| JP3938815B2 (en) | Node creation method, image search method, and recording medium | |
| CN113742288B (en) | Method, electronic device and computer program product for data indexing | |
| CN110362669B (en) | Method suitable for fast keyword retrieval | |
| JP5774213B2 (en) | Method and apparatus for splitting nodes of multiple search trees based on cumulative moving average | |
| CN115495457B (en) | Data processing system, equipment and storage medium based on single machine vector database | |
| JP4936455B2 (en) | Document classification apparatus, document classification method, program, and recording medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060214 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060328 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20060425 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060524 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100602 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |