Weka --- 關聯規則挖掘

算法屬性設置:

1.car:如果設爲真,則會挖掘類關聯規則而不是全局關聯規則。
2.classindex: 類屬性索引。如果設置爲-1,最後的屬性被當做類屬性。
3.delta: 以此數值爲迭代遞減單位。不斷減小支持度直至達到最小支持度或產生了滿足數量要求的規則。
4.lowerBoundMinSupport: 最小支持度下界。
5.metricType: 度量類型,設置對規則進行排序的度量依據。可以是:置信度(類關聯規則只能用置信度挖掘),提升度(lift),槓桿率(leverage),確信度(conviction)。
在 Weka中設置了幾個類似置信度(confidence)的度量來衡量規則的關聯程度,它們分別是:
a)Lift : P(A,B)/(P(A)P(B)) Lift=1時表示A和B獨立。這個數越大(>1),越表明A和B存在於一個購物籃中不是偶然現象,有較強的關聯度.
b)Leverage :P(A,B)-P(A)P(B)
Leverage=0時A和B獨立,Leverage越大A和B的關係越密切
c) Conviction:P(A)P(!B)/P(A,!B) (!B表示B沒有發生) Conviction也是用來衡量A和B的獨立性。從它和lift的關係(對B取反,代入Lift公式後求倒數)可以看出,這個值越大, A、B越關聯。
6.minMtric :度量的最小值。
7.numRules: 要發現的規則數。
8.outputItemSets: 如果設置爲真,會在結果中輸出項集。
9.removeAllMissingCols: 移除全部爲缺省值的列。
10.significanceLevel :重要程度。重要性測試(僅用於置信度)。
11.upperBoundMinSupport: 最小支持度上界。 從這個值開始迭代減小最小支持度。
12.verbose: 如果設置爲真,則算法會以冗餘模式運行。

=== Run information ===
%運行信息


Scheme:       weka.associations.Apriori -I -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1
%  算法的參數設置:-I -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.5 -S -1.0 -c -1 ;
%  各參數依次表示:
%  I - 輸出項集,若設爲false則該值缺省;
%  N 10 - 規則數爲10;
%  T 0 – 度量單位選爲置信度,(T1-提升度,T2槓桿率,T3確信度);
%  C 0.9 – 度量的最小值爲0.9;
%  D 0.05 - 遞減迭代值爲0.05;
%  U 1.0 - 最小支持度上界爲1.0;
%  M 0.5 - 最小支持度下屆設爲0.5;
%  S -1.0 - 重要程度爲-1.0;
%  c -1 - 類索引爲-1輸出項集設爲真
%  (由於car, removeAllMissingCols, verbose都保持爲默認值False,因此在結果的參數設置爲缺省,若設爲True,則會在結果的參數設置信息中分別表示爲A, R,V)


Relation:     mushroom %數據名稱
Instances:    8124 %數據項個數
Attributes:   23 %屬性項個數/屬性項
              cap-shape
              cap-surface
              cap-color
              bruises?
              odor
              gill-attachment
              gill-spacing
              gill-size
              gill-color
              stalk-shape
              stalk-root
              stalk-surface-above-ring
              stalk-surface-below-ring
              stalk-color-above-ring
              stalk-color-below-ring
              veil-type
              veil-color
              ring-number
              ring-type
              spore-print-color
              population
              habitat
              class
=== Associator model (full training set) ===

Apriori
=======

Minimum support: 0.95 (7718 instances)  %最小支持度0.95,即最少需要7718個實例
Minimum metric <confidence>: 0.9   %最小度量<置信度>: 0.9
Number of cycles performed: 1 %進行了1輪搜索

Generated sets of large itemsets:
%生成的頻繁項集

Size of set of large itemsets L(1): 3   %頻繁1項集:3個

Large Itemsets L(1):  %頻繁1項集(outputItemSets設爲True, 因此下面會具體列出)
gill-attachment=f 7914
veil-type=p 8124
veil-color=w 7924

Size of set of large itemsets L(2): 3


Large Itemsets L(2):  %頻繁2項集
gill-attachment=f veil-type=p 7914
gill-attachment=f veil-color=w 7906
veil-type=p veil-color=w 7924

Size of set of large itemsets L(3): 1  

Large Itemsets L(3):  %頻繁3項集
gill-attachment=f veil-type=p veil-color=w 7906

Best rules found:   %最佳規則

 1. veil-color=w 7924 ==> veil-type=p 7924    conf:(1)
 2. gill-attachment=f 7914 ==> veil-type=p 7914    conf:(1)
 3. gill-attachment=f veil-color=w 7906 ==> veil-type=p 7906    conf:(1)
 4. gill-attachment=f 7914 ==> veil-color=w 7906    conf:(1)
 5. gill-attachment=f veil-type=p 7914 ==> veil-color=w 7906    conf:(1)
 6. gill-attachment=f 7914 ==> veil-type=p veil-color=w 7906    conf:(1)
 7. veil-color=w 7924 ==> gill-attachment=f 7906    conf:(1)
 8. veil-type=p veil-color=w 7924 ==> gill-attachment=f 7906    conf:(1)
 9. veil-color=w 7924 ==> gill-attachment=f veil-type=p 7906    conf:(1)
10. veil-type=p 8124 ==> veil-color=w 7924    conf:(0.98)

發佈了43 篇原創文章 · 獲贊 13 · 訪問量 30萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章