Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to...

19
Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability 1 Chapter 2 Introduction to Probability 2.1 Overview 확률()우연에 따라 좌우되는 게임(주사위, 동전, 카드, …)에서 특정 사건의 발생 가능성을 수량화 하기 위하여 탄생 (1) 개의 주사위를 5 던지는 실험에서 결과 : 모집단 {1, 2, 3, 4, 5, 6}에서 단순임의 복원추출(simple random sampling with replacement)이용해 5 개의 표본을 추출하는 > sample(1:6, 5, replace=TRUE) [1] 5 4 3 1 3 (2) 1 개의 동전을 2 던지는 실험에서 결과 : 모집단 {HH, HT, TH, TT}에서 단순임의 복원추출(simple random sampling with replacement)이용해 1 개의 표본을 추출하는 > sample(c('HH','HT','TH','TT'), 1, replace=TRUE) [1] "HH" [실습 2.1] 1 개의 동전을 3 던지는 실험에서 결과

Transcript of Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to...

Page 1: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

1

Chapter 2 Introduction to Probability

2.1 Overview

확률(론)은 우연에 따라 좌우되는 게임(주사위, 동전, 카드, …)에서 특정 사건의

발생 가능성을 수량화 하기 위하여 탄생

(1) 한 개의 주사위를 5번 던지는 실험에서 결과

: 모집단 {1, 2, 3, 4, 5, 6}에서 단순임의 복원추출(simple random sampling with

replacement)을 이용해 5개의 표본을 추출하는 것

> sample(1:6, 5, replace=TRUE)

[1] 5 4 3 1 3

(2) 1개의 동전을 2번 던지는 실험에서 결과

: 모집단 {HH, HT, TH, TT}에서 단순임의 복원추출(simple random sampling with

replacement)을 이용해 1개의 표본을 추출하는 것

> sample(c('HH','HT','TH','TT'), 1, replace=TRUE)

[1] "HH"

[실습 2.1]

1개의 동전을 3번 던지는 실험에서 결과

Page 2: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

2

2.2 표본공간과 사건

Definition 2.2-1

Sample space of the experiment (S): the set of all possible outcomes of an

experiment

: 한 실험에서 가능한 모든 결과의 집합을 실험의 표본공간(sample space)이라

하고 S로 표기된다.

Example 2.2-1

(a) 2 개의 부품을 선택하고 각각 정상(non-defective, N), 불량(defective, D)으로

분류하는 실험에 대한 표본공간

: S1 = {NN, ND, DN, DD}

(b) 2개의 부품을 선택하고 불량품의 수를 기록하는 실험에 대한 표본공간

: S2 = {0, 1, 2}

(c) 2 번째 불량품을 발견할 때까지 검사한 부품들의 수를 기록하는 실험에 대한

표본공간

: S3 = {2, 3, …}

Example 2.2-2

특정 대학의 학생 1 명을 뽑아 태양에너지 사용확장에 대한 학생 의견을

1~10점으로 기록한다.

(a) 이 실험은 표본공간을 구하시오.

: S={1, 2, …, 10}

(b) 표본공간과 모집단(population)은 어떻게 다른가?

: 모집단은 이 대학의 전체 학생들로부터의 의견점수의 모임이다. (동일한 점수의

반복이 가능)

표본공간은 가능한 결과들의 모임이다. (동일한 점수의 반복이 안됨)

Page 3: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

3

Example 2.2-3

특정 대학의 학생 3 명을 뽑아서 태양에너지 사용확산에 대한 학생 의견을

1~10점으로 기록한다.

(a) 이 실험의 표본공간을 구하시오. 표본공간의 크기를 구하시오.

: 3 명의 의견이 (𝑥𝑥1, 𝑥𝑥2, 𝑥𝑥3)로 구성된 모든 가능한 결과로 기록되었을 때, 1 번째

학생의 응답을 𝑥𝑥1 = 1,2, … ,10, 2 번째 학생의 응답을 𝑥𝑥2 = 1,2, … ,10, 3번째 학생의

응답을 𝑥𝑥3 = 1,2, … ,10으로 표기한다. 따라서, 표본공간은 다음과 같이 표현된다. 𝑆𝑆1 = {(𝑥𝑥1, 𝑥𝑥2, 𝑥𝑥3) ∶ 𝑥𝑥1 = 1,2, … ,10, 𝑥𝑥2 = 1,2, … ,10, 𝑥𝑥3 = 1,2, … ,10}

가능한 표본공간의 크기, 10 × 10 × 10 = 1000

(b) 3 명의 응답에 대한 합계만이 기록된다고 할 때 표본공간을 나타내고 그

크기를 구하시오.

> S1=expand.grid(x1=1:10, x2=1:10, x3=1:10) # lists all triplets in S1

> length(table(rowSums(S1))) # gives the number of different sums

Page 4: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

4

표본공간 (S1) = {3, 4, 5, …, 30}

표본공간의 크기 = 28

Events (사건): collections of individual outcomes, 개별 결과들의 모임

Simple event (단순 사건): an event consisting of only one outcome, 오직 1개의

결과로 이루어진 사건

A ∩ B = ∅

: 만약 두 사건이 공통된 결과가 없어서 함께 발생될 수 없을 때 두 사건 A, B는

배반(disjoint) 또는 상호 배타적(mutually exclusive) 이라고 한다.

Page 5: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

5

결합법칙, 분배법칙, 드 모드강의 법칙

Exercises

1. 다음 각 실험에 대한 표본공간을 구하시오.

(a) 1개의 주사위를 2번 던지고 결과들을 기록한다

: {(1,1), (1,2), …, (6,6)}

(b) 1개의 주사위를 2번 던지고 그 결과들의 합을 기록한다.

: {2, 3, 4, …, 12}

(c) 불량품 6 개를 포함하고 있는 500 개의 제품들에서, 30 개의 제품을 단순임의

추출할 때 이 표본에 포함된 불량품의 수를 기록 한다.

: {0, 1, 2, …, 6}

(d) 1 번째 불량품이 발견될 때까지 제품들을 검사할 때 관찰된 제품들의 수를

기록한다.

: {1, 2, …}

Page 6: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

6

2.3 Experiments with Equally Likely Outcomes

2.3.1 확률의 정의와 표현

P(E): probability of an event E, to quantify the likelihood of occurrence of E by

assigning a number from the interval [0, 1]

: 구간[0, 1]로부터 하나의 숫자를 할당하여 사건 E의 발생 가능성을 수치화

Limiting relative frequency

(n → ∞) 𝑁𝑁𝑛𝑛(𝐸𝐸)𝑛𝑛

Probability of Each of N Equally Likely Outcomes

어떠한 실험의 표본공간이 발생확률이 같은 N 개의 결과들로 구성된다면 각

결과의 확률은 1/N이다.

Assignment of Probabilities in the Case of N Equally Likely Outcomes

P(E) =𝑁𝑁(𝐸𝐸)𝑁𝑁

Example 2.3-1

레이저 다이오드(laser diodes)의 효율은 2에서 4까지 다양하다. 100개 중에서, 2,

2.5, 3, 3.5, 4의 효율성을 가지는 다이오드들의 수가 각각 10, 15, 50, 15, 10개가

있다. 한 개의 레이저 다이오드를 임의로 선택할 때, 사건 E1={선택된 레이저

다이오드의 효율성이 3 인 경우}, E2={선택된 레이저 다이오드의 효율성이 적어도

3인 경우}의 확률을 구하시오.

Solution N = 100, N(𝐸𝐸1) = 50, N(𝐸𝐸2) = 75 𝑃𝑃(𝐸𝐸1) = 0.5,𝑃𝑃(𝐸𝐸2) = 0.75

Page 7: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

7

Example 2.3-2

2 개의 주사위를 던질 때 합이 7인 사건의 확률을 구하시오.

Solution

N=36, A={(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)}

N(A)=6

P(A)=6/36=1/6

2.3.2 Counting Techniques

Definition 2.3-1

(1) Permutation (순열) : ordered outcomes

(2) Combination (조합) : unordered outcomes

Number of Permutations of k Units Selected from n

𝒏𝒏𝑷𝑷𝒌𝒌 = 𝑷𝑷𝒌𝒌,𝒏𝒏

Number of Combinations of k Units Selected from n

𝒏𝒏𝑪𝑪𝒌𝒌 = �𝒏𝒏𝒌𝒌�

: 이항계수 (binomial coefficients)

(1) a, b, c 를 배열하는 서로 다른 순서의 경우 수 = 6가지

abc, acb, bac, bca, cab, cba

3×2×1=6(=3!)

> factorial(3)

[1] 6

(2) 8명의 사람으로 이루어진 집단에서 2명을 선택하는 경우의 수는 다음과 같다.

�82� = 8×7

2×1= 28

Page 8: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

8

> choose(8,2)

[1] 28

(3) 𝑃𝑃𝑘𝑘,𝑛𝑛 = 𝑛𝑛𝑃𝑃𝑘𝑘 = 𝑛𝑛𝐶𝐶𝑘𝑘𝑘𝑘! = �𝑛𝑛𝑘𝑘�𝑘𝑘!

> choose(n,r)*factorial(r)

Page 9: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

9

2.4 Conditional Probability : 조건부 확률

2.4.1 The multiplication rule and tree diagrams

: 두 사건에 대한 곱셈 규칙

: 세 사건에 대한 곱셈 규칙

2.4.2 Law of total probability and Bayes’ theorem

: 표본공간의 Partition (분할)

: 전확률 법칙

Page 10: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

10

Example 2.5-13 모든 남자들의 5%와 여자들의 0.25%는 색맹이다. 55% 여자들과 45% 남자들로

이루어진 한 지역사회에서 임의로 한 사람을 선택한다.

(a) 임의로 선택한 사람이 색맹일 확률을 구하시오.

(b) 만약 선택된 사람이 색맹이라면, 그 사람이 남자일 확률을 구하시오.

Solution

B : 선택된 사람이 색맹인 사건

A1 : 남자인 사건

A2 : 여자인 사건

Page 11: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

11

2.5 Independent events : 독립사건

P(B|A)=P(B)

Example 2.5-1 2개의 주사위를 동시에 던질 때 3개의 사건 A, B, C는 다음과 같이 정의된다.

A: 첫번째 주사위의 눈이 3인 사건

B: 두 주사위의 눈의 합이 8인 사건

C: 두 주사위의 눈의 합이 7인 사건

이때 다음의 각 문항에 답하시오.

(1) A와 B는 독립인가?

(2) A와 C는 독립인가?

Solution

A={(3,1), (3,2), (3,3), (3,4), (3,5), (3,6)}

B={(2,6), (3,5), (4,4), (5,3), (6,2)}

C={(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)}

A∩B={(3,5)}

A∩C={(3,4)}

(1) P(A∩B)=1/36 , P(A)=6/36, P(B)=5/36

P(A)P(B) = (6/36)(5/36) ≠ 1/36

A와 B는 독립이 아니다.

(2) P(A∩C)=1/36 , P(A)=6/36, P(C)=6/36

P(A)P(C) = (6/36)(6/36) =1/36

A와 C는 독립이다.

Page 12: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

12

2.6 Association Rule Mining

2.6.1 연관규칙 마이닝, Association Rule Mining – ARM

(1) 아이템(items)과 거래(transactions) 데이터를 이용하여 아이템 간의 연관성을

분석 (아이템=사건, 거래=실험결과)

(2) 아이템과 트랜잭션 데이터 집합

I={i1, i2, …, in} : n개의 아이템 집합

T={t1, t2, …, tm} : m개의 트랜잭션 집합

(ex) Wal mart data

I={Beer, Nuts, Diaper, Coffee, Eggs, Milk}

T={10,20,30,40,50}

(3) 개별 트랜잭션은 번호(unique identical number)와 이에 포함된 아이템들로

구성

𝑡𝑡𝑗𝑗 = �𝑖𝑖𝑗𝑗1, 𝑖𝑖𝑗𝑗2, … , 𝑖𝑖𝑗𝑗𝑗𝑗� (ex) Wal mart data

t10=(Beer, Nuts, Diaper)

(4) 연관규칙의 표현 - X 아이템이 거래되고 나서 Y 아이템이 거래된 것을 의미 X → Y

X와 Y는 아이템집합에 포함된 아이템

X: 선행사건(antecedent), lhs(left hand side)

Y: 후행사건(consequent), rhs(right hand side)

Page 13: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

13

(6) Market basket analysis (장바구니 분석), Frequent patterns analysis (빈발패턴

분석) 이러라고도 함.

2.6.2 ARM의 3가지 평가 측도(evaluation measures)

: 지지도(support), 신뢰도(confidence), 향상도(lift)

(1) 지지도 - 두 사건(event) A와 B에 대하여 A와 B가 동시에 발생할 확률 𝐏𝐏(𝐀𝐀⋂𝐁𝐁)

(2) 신뢰도 - A가 발생했다는 조건 하에서 B가 발생할 확률 𝐏𝐏(𝐁𝐁|𝐀𝐀)

(3) 향상도 𝐏𝐏(𝐁𝐁|𝐀𝐀)𝐏𝐏(𝐁𝐁)

(4) 지지도와 신뢰도 최소 확률값을 정하여 이 값보다 큰 규칙들에 대하여

의미를 부여

: ARM에서는 최소 임계값(minimum threshold)

2.6.3 Support (지지도)

support(X → Y) = P(X ∩ Y) =X 와 Y 를 함께 포함하고 있는 트랜잭션 수

전체 트랜잭션 수

0 ≤ support(X → Y) ≤ 1

(1) 규칙 (X→Y)의 지지도는 X 와 Y 를 동시한 포함한 트랜잭션 수를 전체

트랜잭션 수로 나눈 값

(2) 1에 가까울수록 같은 트랜잭션에 속한 X와 Y는 전체 트랜잭션에서 차지하는

중요도가 커짐.

(3) 지지도가 0 에 가깝다는 것은 전체 트랜잭션에서 차지하는 비중이 크지

않다는 것을 의미

Page 14: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

14

(4) 일반적으로 지지도는 자주 발생하지 않은 규칙을 우선적으로 제거하는데

사용

(5) (𝑋𝑋 → 𝑌𝑌) 와 (𝑌𝑌 → 𝑋𝑋)의 지지도 값은 같기 때문에 두 규칙 간의 차이를 알 수

없음. support(X → Y) = P(X ∩ Y) = 𝑃𝑃(𝑌𝑌 ∩ 𝑋𝑋) = support(Y → X)

(6) (5)의 문제점을 보완하기 위하여 신뢰도 이용.

2.6.4 Confidence (신뢰도)

confidence(X → Y) = P(Y|X) =P(X ∩ Y)

P(X)

=X 와 Y 를 함께 포함하고 있는 트랜잭션 수

X 를 포함한 트랜잭션 수

0 ≤ confidence(X → Y) ≤ 1

(1) X가 발생하였다는 조건 하에서 Y가 발생할 확률로 정의되는 신뢰도는 다음과

같이 X와 Y의 지지도(P(X⋂Y))를 X의 지지도(P(X))로 나눈 값이다.

confidence(X → Y) = P(Y|X) =P(X ∩ Y)

P(X)=

support(X → Y)support(X)

: 지지도 값이 1에 가까울수록 X는 Y에 많은 영향을 줌.

(2) 보통 최소 지지도 값 이상의 연관규칙들 중에서 큰 신뢰도 값을 갖는

규칙들이 의미 있는 것으로 최종 판단

(3) 규칙 (X → Y) 와 (Y → X) 의 지지도 값은 같지만 신뢰도 값은 같지 않다.

따라서 신뢰도는 두 아이템 X와 Y사이의 연관성을 확인할 수 있음.

Page 15: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

15

2.6.5 Lift (향상도)

)(support)(support)(support

)()()(

)()|(

)(support)(confidence)(lift

YXYX

YPXPYXP

YPXYP

YYXYX →

===→

=→

0 ≤ lift(X → Y) < ∞

(1) X와 Y의 향상도는 X와 Y의 신뢰도를 Y의 지지도로 나눈 값

(2) 최종적으로 X와 Y의 지지도를 X와 Y, 각각의 지지도로 나눈 값

(3) 향상도 값은 확률이 아니고 이론적으로 0에서 무한대(∞) 사이의 값을 갖는다.

(4) 향상도 값이 1이 되면 X와 Y는 서로 독립(independent)이 된다.

lift(X → Y) =𝑃𝑃(𝑋𝑋⋂𝑌𝑌)𝑃𝑃(𝑋𝑋)𝑃𝑃(𝑌𝑌)

= 1 , 𝑃𝑃(𝑋𝑋 ∩ 𝑌𝑌) = 𝑃𝑃(𝑋𝑋)𝑃𝑃(𝑌𝑌)

: X와 Y는 서로 영향을 미치지 않는다.

(5) 만약 향상도 값이 1 보다 크면 X 와 Y 는 서로 보완(complementary) 관계가

된다. 즉, X가 증가(감소)함에 따라 Y도 함께 증가(감소)한다.

(6) 반면에 X와 Y의 향상도 값이 1보다 작게 되면 상호 대체(substitutive) 관계가

된다. 즉 X가 증가(감소)함에 따라 Y는 감소(증가)한다.

(7) 향상도 값에 따른 X와 Y의 관계

lift(X → Y) =

⎩⎪⎨

⎪⎧> 1 𝑋𝑋 𝑎𝑎𝑛𝑛𝑎𝑎 𝑌𝑌 𝑎𝑎𝑎𝑎𝑎𝑎 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑎𝑎𝑐𝑐𝑎𝑎𝑛𝑛𝑡𝑡𝑎𝑎𝑎𝑎𝑐𝑐 (상호보완)

1 𝑋𝑋 𝑎𝑎𝑛𝑛𝑎𝑎 𝑌𝑌 𝑎𝑎𝑎𝑎𝑎𝑎 𝑖𝑖𝑛𝑛𝑎𝑎𝑎𝑎𝑐𝑐𝑎𝑎𝑛𝑛𝑎𝑎𝑎𝑎𝑛𝑛𝑡𝑡 (독립)

< 1 𝑋𝑋 𝑎𝑎𝑛𝑛𝑎𝑎 𝑌𝑌 𝑎𝑎𝑎𝑎𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑡𝑡𝑖𝑖𝑡𝑡𝑠𝑠𝑡𝑡𝑖𝑖𝑠𝑠𝑎𝑎 (상호 대체)

Page 16: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

16

2.6.6 Example

[Wal Mart Case]

P(beer) = , P(diaper) = , P(beer ∩ diaper) =

P(beer | diaper) = , P(diaper | beer) =

P(diaper | beer)

P(diaper)= ,

P(beer | diaper)P(beer)

=

Page 17: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

17

> library(arules)

> library(arulesViz)

> tr = read.transactions("c:/data/walmart.txt", format = "basket", sep = ",")

> tr

transactions in sparse format with

5 transactions (rows) and

6 items (columns)

> rules = apriori(tr, parameter = list(support = 0.1, confidence = 0.8))

> rules

set of 46 rules

> inspect(rules)

Page 18: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

18

> inspect(head(sort(rules, by = "support"), 10))

> inspect(head(sort(rules, by = "confidence"),10))

Page 19: Chapter 2 Introduction to Probabilitydelab.cju.ac.kr/stat2.pdf · 2018-09-11 · Introduction to Statistics (Fall, 2018) Chapter 2 Introduction to Probability . 1 Chapter 2 Introduction

Introduction to Statistics (Fall, 2018)

Chapter 2 Introduction to Probability

19

> inspect(head(sort(rules, by = "lift"), 10))