Secure Data Management and Web Applications Lab 1 01172013 TA Duncan Yung Teaching Assistant Duncan Office Rm6505 Sennott Square Email cs1655staffcspittedu Office Hr TBD Association Rule ID: 180965
Download Presentation The PPT/PDF document "CS 1655: " is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
CS 1655: Secure Data Management and Web Applications
Lab 1
01-17-2013
TA: Duncan YungSlide2
Teaching AssistantDuncanOffice: Rm6505,
Sennott
Square
Email: cs1655-staff@cs.pitt.edu
Office Hr: TBDSlide3
Association Rule
We want to find the association between weather(temperature, wind, humidity) and “play”.
Weather and “Play”
Itemset
Temperature
Wind
Humidity
Play
1
Warm
Calm
Dry
Play
2
Cold
Calm
Dry
Play
3
Cold
Windy
Raining
Not Play
4
Cold
Gale
Dry
Not Play
5
Cold
Calm
Raining
Not PlaySlide4
Association Rule
{Cold, Raining} =>
Not Play
{
Windy}
=>
Not Play
Try to compute the
support
and
confident
for each of the below association rule.
Itemset
Temperature
Wind
Humidity
Play
1
Warm
Calm
Dry
Play
2
Cold
Calm
Dry
Play
3
Cold
Windy
Raining
Not Play
4
Cold
Gale
Dry
Not Play
5
Cold
Calm
Raining
Not PlaySlide5
Association Rule-Answer
{Cold, Raining} =>
Not Play
Support: 2/5 = 40%
Confidence: 2/2 = 100%
2.
{Windy} => Not Play Support: 1/5 = 20%
Confidence: 1/1 = 100%
{Cold, Raining} => Not Play
{Windy} => Not Play
Itemset
Temperature
Wind
Humidity
Play
1
Warm
Calm
Dry
Play
2
Cold
Calm
Dry
Play
3
Cold
Windy
Raining
Not Play
4
Cold
Gale
Dry
Not Play
5
Cold
Calm
Raining
Not PlaySlide6
Association Rule
3. {Calm, Dry} => Play
4. {Dry} => Not Play
Try to compute the
support
and
confident
for each of the below association rule.
Itemset
Temperature
Wind
Humidity
Play
1
Warm
Calm
Dry
Play
2
Cold
Calm
Dry
Play
3
Cold
Windy
Raining
Not Play
4
Cold
Gale
Dry
Not Play
5
Cold
Calm
Raining
Not PlaySlide7
Association Rule
3. {Calm, Dry} => Play
Support: 2/5 = 40%
Confidence: 2/2 = 100
%
4. {Dry
} =>
Not Play
Support: 1/5 = 20%
Confidence: 1/3 = 33.3%
3. {Calm, Dry} => Play
4. {Dry} => Not Play
Itemset
Temperature
Wind
Humidity
Play
1
Warm
Calm
Dry
Play
2
Cold
Calm
Dry
Play
3
Cold
Windy
Raining
Not Play
4
Cold
Gale
Dry
Not Play
5
Cold
Calm
Raining
Not PlaySlide8
Association Rule
{Cold, Raining} =>
Not Play
Support: 2/5 = 40%
Confidence: 2/2 = 100%
2.
{Windy} => Not Play Support: 1/5 = 20%
Confidence: 1/1 = 100%
3. {Calm, Dry} => Play
Support: 2/5 = 40%
Confidence: 2/2 = 100
%4. {Dry} => Not Play
Support: 1/5 = 20% Confidence: 1/3 = 33.3%
If the support and confident thresholds
are 40% and 50% respectively, which association
rule(s) is/are valid?
{Cold, Raining} =>
Not Play
{
Windy} =>
Not Play
{Calm, Dry} => Play
{Dry} => Not Play
Rule 1,3
Itemset
Temperature
Wind
Humidity
Play
1
Warm
Calm
Dry
Play
2
Cold
Calm
Dry
Play
3
Cold
Windy
Raining
Not Play
4
Cold
Gale
Dry
Not Play
5
Cold
Calm
Raining
Not PlaySlide9
AprioriAn algorithm to generate strong association rules from the frequent
itemsets
Find frequent
itemset
(s) that has support >= 2
Please refer to lecture note slide 18,19 for
Apriori
AlgoSlide10
AprioriSlide11
ConfidenceGiven frequent
itemset
{B,C,E},
What association rule can be generated?
F
ind all possible association rule and compute their confidence.
Refer to lecture notes slide 15 Slide12
ConfidenceGiven frequent
itemset
{B,C,E},
f
ind all possible association rule and compute their confidence.
B,C=>E Confidence=2/2=100%
C,E=>B Confidence=2/2=100%
B,E=>C Confidence=2/3=66%B=>C,E Confidence=2/2=100%C=>B,E Confidence=2/3=66%E=>B,C Confidence=2/3=66%Slide13
ReferenceSome slides are from Kenneath
Leung, San Jose State University.
https://dspace.ist.utl.pt/bitstream/2295/55704/1/licao_9.pdf