Presentation is loading. Please wait.

Presentation is loading. Please wait.

8 Unsupervised method 서울시립대학교 전기전자컴퓨터공학과 G201449015 이가희 고급컴퓨터알고리듬.

Similar presentations


Presentation on theme: "8 Unsupervised method 서울시립대학교 전기전자컴퓨터공학과 G201449015 이가희 고급컴퓨터알고리듬."— Presentation transcript:

1 8 Unsupervised method 서울시립대학교 전기전자컴퓨터공학과 G201449015 이가희 고급컴퓨터알고리듬

2 0. unsupervised method 클러스터 분석 : finds groups in your data with similar characteristics 계층 클러스터링 k-means 연관 분석 : finds elements or properties in the data that tend occur together Unsupervised method

3 1. cluster analysis 목적 : 데이터내의 관측치들을 clustering 을 통해 그룹화한다. 같은 클러스터 내에서는 유사도가 높아야 한다. 클러스터 분석 hierarchical clustering k-means Unsupervised method 1. Cluster analysis

4 1.1 hierarchical clustering 데이터에서 모든 두 클러스터간의 거리를 계산해 모든 데이터가 하나의 군집으로 병합될 때까 지의 클러스터들을 계층 구조로 만든다. 거리가 가장 가까운 것 2 개를 묶음 ( 반복 ), 하나의 클러스터로 합쳐질 때까지 진행한다. dist(), hclust() 사용 dist(x, method, diag, upper) x : data(numeric matrix) method : 거리 측정 방법 euclidean maximum manhattan binary minkowski diag : T/F upper : T/F Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering hclust(d, method) d : distance data method : 그룹 인접성 측정 방법 ward.D, ward.D2 single complete average median centroid

5 1.1 hierarchical clustering Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering

6 1.1 hierarchical clustering cutree() : 각 클러스터의 멤버들을 추출할 수 있다. cutree(tree, k, h) tree : hcluter 로 생성된 tree data k : 그룹 수 h : 제한 높이 Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering

7 1.1 hierarchical clustering visualizing cluters - 2 차원 클러스터링 주성분분석 (PCA) 을 통해 2 차원 plotting prcomp() : 데이터의 주성분 계산, 많은 변수들로부터 몇 개의 주성분들을 추출한다. prcomp(x) x : data Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering

8 1.1 hierarchical clustering Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering

9 1.1 hierarchical clustering bootstrap evaluation of clusters : clusterboot() library(fpc) clusterboot(data, clustermethod) data : data matrix clustermethod : clustering method kmeansCBI(data, k) : kmeans clustering hclustCBI(data, k, method) : agglomerative hierarchical clustering … Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering

10 1.1 hierarchical clustering Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering original cluster 와 resampling cluster 간의 자카드 유사도가 같거나 작을경우, original cluster 와 resampling cluster 간의 자카드 유사도가 큰 경우,

11 1.1 hierarchical clustering 최적의 클러스터 수 산정 문제 Calinski-Harabasz index : 클러스터내 분산, 클러스터간 분산을 이용해 클러스터 개수를 선택한다. 클러스터내분산 (W) = WSS(k) / (n-k) 클러스터간분산 (B) = BSS(k) / (k-1) ch = B / W, 최대값을 가지는 k 를 클러스터 개수의 추정치로 선택한다. good cluster : small WSS(k), large BSS(k) WSS(total within sum of square) : 클러스터내 모든 점들의 평균점 - centroid 로 정의 BSS(between sum of square) : TSS-WSS(k) Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering

12 Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering 1.1 hierarchical clustering

13 Unsupervised method 1. Cluster analysis 1.1 hierarchical clustering 1.1 hierarchical clustering

14 1.2 k-means algorithm K 개의 클러스터를 만들어 각 클러스터의 중심점을 기준으로 클러스터가 변화한다. kmeans() 사용 kmeans(x, centers, iter.max, nstart, algorithm, trace) x : data centers : 클러스터 개수 (k) iter.max : 반복 횟수 nstart : 선택할 random sets 개수 algorithm Hartigan-Wong Lloyd Forgy MacQueen trace : T/F Unsupervised method 1. Cluster analysis 1.2 k-means algorithm

15 1.2 k-means algorithm bootstrap evaluation of clusters : clusterboot() library(fpc) clusterboot(data, clustermethod) data : data matrix clustermethod : clustering method kmeansCBI(data, k) : kmeans clustering hclustCBI(data, k, method) : agglomerative hierarchical clustering … Unsupervised method 1. Cluster analysis 1.2 k-means algorithm

16 1.2 k-means algorithm 최적의 클러스터 수 산정 문제 : kmeansruns() kmeansruns(data, krange, criterion) data : data krange : 비교할 클러스터 범위 criterion ch : Calinski-Harabasz Index asw : average silhouette width a = 어떤 한 클러스터내의 점들의 평균거리 b = 다른 클러스터의 점들의 최소 평균거리 asw = 1-a/b, if a<b Unsupervised method 1. Cluster analysis 1.2 k-means algorithm

17 1.2 k-means algorithm 최적의 클러스터 수 산정 문제 : kmeansruns() kmeansruns(data, krange, criterion) data : data krange : 비교할 클러스터 범위 criterion ch : Calinski-Harabasz Index asw : average silhouette width Unsupervised method 1. Cluster analysis 1.2 k-means algorithm

18 1.2 k-means algorithm 최적의 클러스터 수 산정 문제 : kmeansruns() kmeansruns(data, krange, criterion) data : data krange : 비교할 클러스터 범위 criterion ch : Calinski-Harabasz Index asw : average silhouette width Unsupervised method 1. Cluster analysis 1.2 k-means algorithm

19 2. Association rules Transaction – “togetherness” 트랜잭션간 연관성을 찾는 방법 ” if X, then Y – conf(X=>Y) = support(union(X,Y) / support(X)) Support(X) = X / T 최소 10% 의 지지도와 60% 의 신뢰도를 갖는 연관 규칙을 찾는다. Unsupervised method 2. Association rules

20 2. Association rules Unsupervised method 2. Association rules

21 2. Association rules Unsupervised method 2. Association rules......

22 2. Association rules apriori(data, parameter) data : data parameter support confidence Unsupervised method 2. Association rules

23 2. Association rules inspect(x) Unsupervised method 2. Association rules sort, sift 권장 lift : lhs, rhs 가 독립적인지 아닌지 판단하는 척도

24 2. Association rules 제한조건 apriori(data, parameter, appearance) data : data parameter support confidence appearance : 제한조건 Unsupervised method 2. Association rules

25 2. Association rules inspect(x) cf) Unsupervised method 2. Association rules


Download ppt "8 Unsupervised method 서울시립대학교 전기전자컴퓨터공학과 G201449015 이가희 고급컴퓨터알고리듬."

Similar presentations


Ads by Google