21
Knowledge Discovery from Data Streams 2017. 4. 4 임효상 "Knowledge Discovery from Data Streams" by Joao Gama (Chapman and Hall/CRC; 1st edition) Introduction 지난 30년간 data mining은 static dataset들을 이용한 batch 작업에 focus되어 있음 Dynamic 환경에서의 data mining 알고리즘은 많은 challenge가 존재함 Data의 concept이 시간에 따라 변하기 때문 이러한 경우에는 incremental algorithm이 필요함 Dynamic 환경에서 끊임없이 생성되는 data 즉, data stream에 맞춰진 application들은 기존의 DBMS에서 수행되는 방법과는 다른 DSMS의 수행방법을 따름 2017-04-04 2

Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Knowledge Discoveryfrom Data Streams

2017. 4. 4

임효상

"Knowledge Discovery from Data Streams" by Joao Gama (Chapman and Hall/CRC; 1st edition)

Introduction

• 지난 30년간 data mining은 static dataset들을 이용한 batch 작업에

focus되어 있음

• Dynamic 환경에서의 data mining 알고리즘은 많은 challenge가 존재함

– Data의 concept이 시간에 따라 변하기 때문

– 이러한 경우에는 incremental algorithm이 필요함

• Dynamic 환경에서 끊임없이 생성되는 data 즉, data stream에 맞춰진

application들은 기존의 DBMS에서 수행되는 방법과는 다른 DSMS의

수행방법을 따름

2017-04-04 2

Page 2: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

An Illustrative Example

• Sensor들은 all around로 분산되어 있음

– 각 sensor들은 sensor가 해당하는 지역(geographical area)이 필요로 하는 전력량(electrical

load)을 측정함

• Electricity distribution company들은 sensor들로 부터 들어오는 필요로

하는 전력량(stream data)을 분석(mining)하여 추후 각 지역의 필요로 하는

전력량을 예측함

– 예측한 값에 따라 추후에 각 sensor들이 위치한 지역에 제공할 전력을 계획함

– 전력이 적게 필요한 지역에 전력을 많이 주거나, 전력이 많이 필요한 지역에 전력을 적게

주는 상황을 방지하기 위함(경제적 이득도 존재함)

2017-04-04 3

An Illustrative Example(Cont’d)

• Data mining을 통해 다음의 task들을 수행할 수 있음

– Cluster Analysis

ex) Identification of profiles: urban, rural, industrial, etc;

– Predictive Analysis

ex) 각 sensor로 부터 들어올 value를 예측할 수 있음

– Monitoring evolution

ex) Change detection, extreme values, anomaly and outliers detection

– Extraction of background information

Network의 topology와 geographical information에 의해서 주어진 정보를 추출

2017-04-04 4

Page 3: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

An Illustrative Example(Cont’d)

• 위의 task들을 수행하는 기존 approach는 다음과 같음

1) Select finite data sample

2) Generate a static model

이렇게 생성된 static model들은 짧은 기간은 good performance를 보일 것이지만,

나중엔 performance가 떨어져서 re-generation이 필요함 (data가 evolving되기 때문에)

2017-04-04 5

is not adequate for the high speed stream of data usually encountered

A World in Movement

• Data의 새로운 특성은 다음과 같음

– 끊임없이 high-speed로 들어오며, unlimited stream임

– 시간이 지남에 따라 evolve됨

– Data의 분포가 iid (independent and identically distributed)이라고 가정할 수 없음

– Data가 시공간적인 상황에 영향을 받음

• 이러한 성질이 기존 knowledge discovery algorithm에 영향을 줄까?

YES

– 기존 batch 기반 algorithm의 많은 부분은 blocking operator로 이루어져 있음

– 예를 들어, 일반적으로 clustering algorithm에는 전치행렬(matrix transpose)구하는 부분이

들어가는데, 이 연산이 blocking operator임

• Data stream은 time과 memory 제약조건으로 인해 one pass scan, on the

fly processing에 맞는 new algorithm이 필요함

2017-04-04 6

Page 4: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Data Mining and Data Streams

• 이러한 문제를 해결하기 위해서는 새로운 sampling, randomizing 방법과

함께 새로운 approximation, incremental algorithm이 필요함

• 일부 data stream에서는 delete와 update를 허용하는 경우도 있고, data

자체에 시간에 따라 context change가 발생하는 경우도 있음

따라서, incremental하게 수행하는 것 뿐만 아니라, outdated data를 discard하는

decremental 요소 또한 필요함

• Another data stream model: block evolution model

– Sequence of data block D1, D2, … 이 연속적으로 들어오는 상황으로 data stream을 모델링

– Model maintenance 문제: data block이 insert 혹은 delete되는 상황에서 data mining

model을 유지하는 것을 목표로 함

– Change detection 문제: 두 개의 data set간의 차이를 계산하고, 언제 통계적으로 중요성을

갖는 change가 발생하는지를 알아내는 것을 목표로 함

2017-04-04 7

Data Mining and Data Streams(Cont’d)

• Data stream에서의 knowledge discovery는 “limited rationality” 성격을 가짐

– Computational resource의 부족으로 인하여 rational decision이 여의치 않음

• Original decision model을 만드는 시점에서 전체 data set이 available하지 않거나,

• 전체 data set이 너무 커서 모두 process하거나 memory에 올리는 것이 불가능하고,

• 계속해서 데이터의 characteristics가 바뀌는 경우가 많음

• 고려해야 하는 새로운 제약조건

– 제한된 computational resource을 고려해야 함

– Limited direct access to data, limited bandwidth communication resource

– Answer는 언제든 준비되어 있어야 함(anytime protocol)

– 데이터 수집과 처리가 분산 되어야 함

2017-04-04 8

Page 5: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Data Stream Models

• Data stream들은 각각의 event가 서로 독립적으로 연속해서 발생하는 확률 과정이라볼 수 있음

– 비고정적인(non-stationary) 분포에 따라 연속해서 대량으로 생성되는 데이터

• DBMS와 DSMS간의 차이점

• Traditional database와 stream data에서의 query processing 차이

2017-04-04 9

Data Stream Models(Cont‘d)

• DSMS의 특징

1. Stream내의 data element는 on-line으로 arrive함

2. System은 stream내의 data element arrive 순서를 control 할 수 없음

(data stream간의 arrive 순서 또한 control 할 수 없음)

3. Data stream의 size는 unbound임

4. Data stream 내의 하나의 element가 process 되었으면, 그 element는 discard되거나

기록됨(archived)

• Streaming model 종류

– Insert only model: 어떤 하나의 element 가 들어왔을 때, 이 element는 change 되지 않음

– Insert-delete model: element 는 delete 혹은 update 될 수 있음

– Additive model: 어떤 하나의 element 가 들어왔을 때 기존 에 를 추가함

2017-04-04 10

Page 6: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Research Issue in Data Streams Management Systems

1. Approximate query processing technique

2. Sliding window query processing

- Approximation technique을 위해서 필요

- Query language의 option으로서 필요

3. Sampling technique

- Input stream rate가 query processor 보다 빠를 경우 처리를 위해서

4. Blocking operation(e.g., sorting, aggregation) processing technique

- Unending streams 을 처리하기 위해서

이러한 type의 query를 처리하기 위해서는 summaries나 synopsis와 같은 과거 데이터에

대한 정보가 필요

Trade off: size of summaries and precision of answers

2017-04-04 11

Basic Streaming Method

• Data stream은 length가 unbound이며, attribute의 possible value domain은

매우 클 수 있는 문제가 존재함 (e.g., IP addresses in network packets)

• 모든 data를 저장하고 query를 수행하는 것은 불가능한 일임

• 또한 과거 데이터들에 대해서는 summaries or synopsis를 이용해서

store하고 query를 수행해야 함

– Summaries size와 정확한 answer를 제공하는 것 사이의 trade-off가 존재함

– 이러한 solution은 space가 요구됨

– 어떻게 하면 space보다 적게 사용할 수 있을까 ?

2017-04-04 12

Page 7: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Basic Streaming Method (cont’d)

• Data stream을 process하는 알고리즘들은 일반적으로 sub-linear time 과

space를 가짐 (그 이상의 complexity이면 data stream환경에서 사용할 수 없음)

– 하지만 이러한 알고리즘들은 approximate 값을 answer로 냄

– 세가지 제약조건을 고려해야 함 Amount of memory used to store information

The time to process each data element

Time to answer the query of interest

• 일반적으로 two type의 approximate answer를 확인 할 수 있음

– ∈ Approximation: error의 비율이 ∈ 일때 answer는 correct함

– (∈, ) Approximation: answer가 correct 결과의범위인 1 ∈ 안에 속할 확률은 1 임• ∈: 허용 범위 (0 ≤ ∈ ≤ 1), : 오류 확률 (0 ≤ ≤ 1)

• Constant ∈ 와 는 space 에 많은 영향을 줌

– 일반적으로 space는∈log 1/

– 허용 범위가 작을 수록, 오류 확률이 작을 수록 더 많은 공간을 필요로 함

2017-04-04 13

Illustrative Examples

• Counting the Number of Occurrence of the Elements in a Stream

– IP set 중에서 각 IP의 빈도수가 몇인지 판단하는 상황

– 모든 IP에 대해서 각각 저장공간을 주어 빈도수를 저장하는 것은 공간을 너무 많이 차지함

– 빈도수를 저장하는 공간을 줄여서 빈도수를 측정할 수 있는 Count-Min Sketch 방법을 사용

– Count-Min Sketch

size의 array 를 선언 ( 1/ , log 1/ ) )

Stream 내의 각 element(IP)마다 종류의 hash 함수에 모두 input으로 넣고, 해당 하는 hash bucket의

count를 증가시킴

특정 element(IP)의 빈도수를 알고 싶으면 모든 종류의 hash 함수의 값(hash(IP)) 중 가장 작은 값을

빈도수로 output을 냄

2017-04-04 14

Page 8: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Illustrative Examples(Cont’d)

• Counting the Number of Distinct Values in a Stream

– Data stream 속에서 value의 종류는 몇 개 인지 알아보는 상황

– Hash Sketch 알고리즘을 사용

특정 hash 함수 에 data stream 내의 value 를 input으로 넣음

값을 이진수로 변환한 뒤 값을 구함

을 index로 하는 BITMAP의 값을 1로 set함

종류의 개수 근사치는 2 로 구함

원리: d개의 distinct value가 있을 때,

BITMAP[0]에는 d/2개의 value가 map되고, BITMAP[1]에는 d/4개의 value가 map 됨

BITMAP[r-1]에는 d/2 개의 value가 map됨, 종류가 많을수록 R값이 클 확률이 높음

2017-04-04 15

lsb: least-significant 1 bit, 즉 이진수에서 1을나타내는 가장 오른쪽 indexex) lsb(0100) 2

3 1 mod 5 라 가정

R: BITMAP에서 rightmost zero인 index

input stream이 1~4까지의 자연수인 경우의 예

Maintaining Simple Statistics from Data Streams

• Data stream에서의 평균 구하는 법

– 이점: 모든 시점의 element를 저장하지 않고 3가지 값( ̅ , , )만 알면 평균을 구할 수 있음

• Data stream에서의 표준 편차 구하는 법

– 이점: 3가지 값(∑ ,∑ , )만 알면 표준 편차를 구할 수 있음

2017-04-04 16

xi : i 시점에서의 평균, xi : i 시점에 입력된 element 값

Page 9: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Maintaining Simple Statistics from Data Streams (Cont’d)

• 두 가지 Data stream( , )간의 상관계수를 구하는 법

– 이점: 5가지 값(∑ ,∑ , ∑ , ∑ ,∑ )만 알면 상관계수를 구할 수 있음

2017-04-04 17

Sliding Windows

• 최근에는 과거의 data까지 모두 포함하여 computing하는 것에는 흥미가 없음

• 하지만 근접한 과거의 data를 포함하여 computing하는 것에는 흥미가 있음

• 현재 시점에서 근접한 과거까지의 fix size의 window로 계산하는 sliding window

개념이 존재

– Sliding window는 first in, first out data structure를 가짐

• Sliding window의 다음과 같이 두 가지 type으로 나뉨

– Sequence based: window size가 element의 개수로 정해짐

– Timestamp based: window size가 duration으로 정해짐

2017-04-04 18

Page 10: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Sliding Windows(Cont’d)

• Note

– Window 내에 오래된 observation을 forgot하는 것이 필요

– Time window에서도 똑같은 problem이 존재 (size를 change했을 경우, 즉 time 변경)

2017-04-04 19

Data Synopsis

• 새로운 data가 끊임없이 도착하고 있는 상황에 모든 old data까지 연산에

사용되면 연산을 실시간으로 처리 하는 것은 불가능

• 그러므로 memory bound 제한을 두어 연산을 수행해야 함

– 이 방법은 정확한 연산 결과값을 제공하지는 못함

• High-quality approximate answer를 제공하는 방법은 두 가지가 존재

– Sliding window

– Data reduction

2017-04-04 20

Page 11: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Data Reduction - Sampling

• 전체의 data stream을 연산에 다루는 것이 아니라, 일부의 data stream만을

선택하여 연산에 다루는 것임

– Process에 사용되는 data의 양을 줄여줌

– 일부의 data stream만을 연산에 사용하기 때문에 오류가 있을 수 있음

• Main problem은 어떻게 representative sample을 얻는 것임

– Original data의 same properties를 갖도록 sampling해야 함

• 확률적인 방법으로 unbiased data sampling을 수행 할 수 있음

– 일반적인 방법을 적용하려면 stream의 길이를 알아야 수행됨

– Data stream 환경에 맞는 기술로 변경할 필요가 있음

2017-04-04 21

Data Reduction - Sampling(Cont’d)

• Online 환경에서 가장 simple한 sampling 방법은 random sampling을 사용하는

reservoir sampling 방법임

– Sample size를 k로 고정 (이 sample을 reservoir라 부름)

– 처음엔 element가 k가 될 때 까지 reservoir에 포함 시킴

– 그 후 element가 도착할 때 마다 k/n 확률로 reservoir에 포함시킬지 구함 (n: 현재까지의 element의 수)

(만약 reservoir에 포함되었다면 reservoir내의 element중 하나를 random하게 버림)

확장하면 모든 data에 대해서 살펴볼 필요 없이 일정 data를 skip하게 할 수도 있음

• Another sampling 방법

– Min-Wise Sampling: distributed streams이 들어와서 merge되는 상황에서, 들어오는 각

stream내의 element마다 0~1사이의 값을 random하게 얻어서 가장 작은 값을 가진

element들을 sample로 선정 분산처리 가능

– Load Shedding: 들어오는 stream의 비율이 system을 과부하 시키려고 할 때 사용 (slow down

data)

2017-04-04 22

Page 12: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Data Reduction – Histograms

• Data stream의 element들의 frequency distribution을 approximate하게

구하여 summarization하는 방법임

• Histogram은 non-overlapping intervals들로 정의됨

– 각 interval은 boundaries가 정의되고 빈도수를 나타나게 됨

2017-04-04 23

Exponential Histograms

2017-04-04 24

• Exponential Histogram(Datar et al. 2002)은 counting 문제를 풀기 위해

자주 사용되는 histogram 구조임

• 간략화한 data stream 환경을 고려함

– 각 element는 같은 data source에서 오고 그 값은 0 또는 1

– 목적은 sliding window에서 1의 개수를 카운팅 하는 것임

• N이 window size라고 가정하면, O(log( ))공간을 사용해서 문제를 해결

할 수 있는가?

Page 13: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Exponential Histograms(Cont’d)

2017-04-04 25

• 기본 아이디어는 다른 사이즈의 버켓을 사용하는 것

• 각 버킷은 타임 스탬프를 가지고 있음

– 타임스탬프는 bucket이 window 범위 밖으로 나가는지를 결정을 하는데 사용됨

• Exponential histogram은 버킷 이외의 두 개의 추가적인 변수를 사용함

– LAST : 마지막 버킷의 사이즈를 저장함

– TOTAL : 버킷의 총 사이즈를 유지함

Exponential Histograms(Cont’d)

2017-04-04 26

• 새로운 데이터 요소가 도착했을 때 값을 체크를 함

• 만약 새로운 데이터의 값이 0이라면 무시함

• 1이면, 현재의 타임스탬프와 증가된 카운터 TOTAL과 함께 사이즈 1의

새로운 버킷을 생성함

• 파라미터 이 주어지고, 만약 |1/ |/2+2 개의 같은 크기의 버킷이 있다면,

같은 사이즈의 가장 오래된 두 개의 버킷을 병합함

– 두 배 크기의 하나의 버킷이 생성됨

– 두 버킷 중 가장 큰 타임스탬프가 새로 생성된 버킷의 타임 스탬프로 사용됨

– 만약 마지막 버킷이 병합된다면, 우리는 병합된 버킷의 사이즈를 카운터 LAST에

업데이트 함

• 버킷 타임스탬프가 윈도우 사이즈 밖으로 벗어나면 그 버킷을 삭제

Page 14: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

An Illustrative Example

2017-04-04 27

• windows size = 10, = 0.5 일 때 ( 은 결국 relative error를 나타냄)

• |1/0.5|/2+2=3 에 따라 같은 사이즈 버킷이 3개이면 머지 수행

• 특정 시점에서의 슬라이딩 윈도우 내의 1의개수는 TOTAL-LAST/2 로 계산됨

An Illustrative Example (Cont’d)

2017-04-04 28

….1 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 1…

Bucket sums = {4, 2, 2, 1}Bucket sums = {4, 2, 2, 1, 1}Bucket sums = {4, 2, 2, 1, 1 ,1}Bucket sums = {4, 2, 2, 2, 1}Bucket sums = {4, 4, 2, 1}

타임스탬프

버킷의 크기

타임스탬프

0 or 1

EH 구조

Page 15: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

A Data Warehouse Problem: Hot-Lists

• Retail data warehouse라 가정

– Data warehouse의 actual size는 3 TB임

– 새로운 sale record들이 hundreds of gigabytes만큼 매일 update됨

• Hot-list problem은 stream data에 대해서 most popular items(top 20)을 지속적으로

확인할 수 있도록 유지하는 것임

– 간단한 방법으로는 각 element의 alphabet 별로 count를 구하여 sort한 뒤 top-k를 구하면 됨

– 하지만 이 방법은 large alphabet에는 적합하지 않음

• Misra and Gries 가 제안한 simple한 frequent 알고리즘

2017-04-04 29

A Data Warehouse Problem: Hot-Lists(Cont’d)

• Misra and Gries가 제안한 알고리즘보다 Space-saving한 알고리즘을 Metwally가 제안

2017-04-04 30

Page 16: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Change Detection

• 많은 application들은 data flow가 끊임없는 dynamic한 환경에서 learning

알고리즘을 수행함

• 만약 process가 strictly stationary하지 않다면, 시간이 지남에 따라 target의

concept이 change된 것임

• 그럼에도 불구하고 대부분의 machine learning 연구는 training example이

고정 확률 분포(stationary probability distribution)에서 random하게

생성된다 가정하고 있음

• Our environment는 naturally dynamic하고 시간에 따라 지속적으로

changing됨

따라서 learning 알고리즘은 이러한 환경을 고려해서 수행되어야 함

2017-04-04 31

Tracking Drifting Concepts

• 많은 application들은 data flow의 성질(concept)가 끊임없이 변하는

dynamic한 환경에서 동작함

• Concept drift란 수집된 data의 concept이 시간이 지남에 따라 shift되는

것을 의미 (each time after some minimum permanence)

2017-04-04 32

Page 17: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Tracking Drifting Concepts(Cont’d)

• Distribution 가 not stationary라고 가정해보자

– Sequences of examples 가 들어오고 있음

– 시간이 지남에 따라 example을 generate하는 distribution은 change됨

– Date stream은 S , S , … , S , … 의 sequence로 표현될 수 있음

( : set of examples generated by a stationary distribution , i.e., 각각이 하나의 context)

– Si 가 충분히 크면 각 의 model은 만들 수 있음 (but 전체에 대해서는 불가능)

• Change point를 detect하는 것이 주요 문제

– 연속된 와 에서 양쪽의 example들이 mix되어 있는 transition phase가 존재

– An example generated by a distribution is noise for

– Noise와 change를 구분할 수 있어야 함 (지속성(persistence)이 그 구분 근거)

– Change detection 알고리즘은 noise에 대해선 robust, change에 대해선 sensitive 해야 함

2017-04-04 33

The Nature of Change

• Causes of change

– Observed variables의 characteristic properties가 change 된 경우

– Hidden variable의 변경으로 인한 learning의 modification된 경우

• Rate of change*

– 보통 abrupt change를 detect하는 것이 더 쉽고, 적은 양의 example로 detection할 수 있음

– Gradual change를 detect하는 것은 좀 더 어려움

• 처음에는 data의 작은 변화가 있는 것을 noise로 간주함

• Noise값이 계속해서 나온다면 noise로부터 change를 구별해 냄

(abrupt change를 detect하는 것 보다 많은 양의 example을 사용)

2017-04-04 34

* Concept drift: concept이 gradual change되는 것과 좀 더 연관 있음Concept shift: concept이 abrupt change되는 것과 좀 더 연관 있음

Page 18: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

The Nature of Change (Cont’d)

• Lazarescu 등(2004)은 concept drift를 consistency와 persistence 를 이용하여 정의함

Change = - where is the state of the target function in time t.

– Consistency : ≥ ( is consistency threshold)

– Persistence : consistent during p times ( where p and w is the window size)

– Consistent하고 persistent 하면, 그 draft는 permanent(real)

– Consistent하지만 persistent하지 않으면, 그 drift는 virtual

– Consistent하지도 않고 persistent 하지도 않으면, noise

2017-04-04 35

Characterization of Drift Detection Methods

• 다양한 drift detection algorithm들이 제시되었음

• 모든 방법들에서 공통적인 것은, 가장 최근의 example들이 가장 관련이

깊다고(relevant) 생각했다는 것임

2017-04-04 36

Page 19: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Data Management

• Decision model의 일관된 성능을 유지하기 위해 data management 방법을 사용

• Full memory 방법

– All example들을 memory에 저장하는 방법

– Example들은 각각의 age에 따라 가중치가 다르게 주어짐 (오래된 example일수록 가중치가 낮아짐)

– 가중치를 linear decay하게 주는 방법

• Fading factor ( 0 < < 1 )

• Weight ,

– Exponential decay하게 주는 방법 등이 있음

• exp where example x was found i time steps ago

• controls how fast the weights decrease

( 가 크면, 과거의 example 더 작은 weight가지게 됨. 가 0이면, 모든 example들이 같은 weight)

2017-04-04 37

Data Management(Cont’d)

• Partial memory 방법

– Mops recent examples만을 memory에 저장하는 방법

– Example들은 first-in first-out (FIFO) 구조로 저장됨(window 기반)

– 각 time step마다 window 내의 example들만을 사용하여 모델을 구성함

– 가장 큰 문제는 window의 적절한 size를 정하는 것임

작은 window size: 최신 분포를 정확하게 반영할 수 있고 change에 대해서 빠르게 적응 할 수 있지만,

concept이 안정된 example이 들어오고 있는 상황에서는 performance가 떨어짐

큰 window size: concept이 안정된 example이 들어오고 있는 상황에서 performance가 좋지만,

concept change에 대한 적응은 빠르게 반영할 수 없음

– Window size를 구성하는 두 가지 방법

Fixed sized window: window size가 고정 (하나가 들어오면 하나가 discard), baseline algorithm

Adaptive size window: window size를 가변적으로 변경 (e.g., ADWIN)

2017-04-04 38

결국 forgetting mechanism의 문제:

Full memory는 gradual forgetting, partial memory는 abrupt forgetting

Page 20: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Detection Methods

• Model의 일관된 성능을 유지하기 위해 change를 detect하는 방법을 사용– Meaningful description 제공 (change point 제시, 혹은 window 중에서 change가 일어난 window를 제시)

– Change의 quantification 제공

• Detection model은 두 가지 approach가 존재

– Monitoring the evolution of performance indicators

• Model의 성능을 계속해서 살펴보면서 성능이 안 좋아지면 drift가 일어났다 판단

• FLORA2 (Widmer 등(1996)): monitoring accuracy and coverage of the current model

• Klinkenberg 등(1998): monitoring accuracy, recall and precision of the current model

– Monitoring distributions on two different time-windows

• 두 개의 window내에 example 분포를 비교하여 차이가 나면 drift가 일어났다 판단

• Kifer 등(2004): monitoring probability distribution of two windows

• VFDTc (Gama 등(2006): monitoring difference between class-distributions of two windows

2017-04-04 39

Detection Methods(Cont’d)

• The Cumulative Sum Algorithm (CUSUM algorithm)

– Typical “classical” change detection algorithm

– Examples 의 mean이 0과 significantly different할 때 alarm

– Sn+1값이 임계값 을 넘기면 alarm을 주고, Sn=0이 됨

– Smaller n : fast detection but increasing false alarms

– Memoryless

2017-04-04 40

likelihood function (예측값)현재 들어온 값

Page 21: Knowledge Discovery from Data Streams chapter(임효상)cs.kangwon.ac.kr/~ysmoon/courses/2017_1/grad/05.pdf · • 현재시점에서근접한과거까지의fixsize의window로계산하는sliding

Detection Methods(Cont’d)

• Page-Hinkley(PH) test

– Typical change detection algorithm in signal processing

– detection of an abrupt change in the average of a Gaussian signal (Mouss 등(2004))

– 는 최대 허용 변화

– PHT 가 임계값 보다 크면 drift가 일어났다 판단 (larger , fewer false alarm but missing changes)

2017-04-04 41

time T 까지의 입력값 평균

mt 의 최소값

최소값과 현재 입력값의 차이

Decision Model Management

• 여러 개의 model을 memory에 유지하는 것에 대한 이야기

– Assumption: data가 multiple distributions으로부터 생성되고, 이것들 사이에 transition됨

– Concept drift 가 일어났을 때마다 새로 model을 만드는 것이 아니라,

– 그에 맞는 기존에 만들어진 model로 변경해야 함

• Dynamic Weighted Majority Algorithm (Kolter 등(2003))

– Ensemble 방법으로, 어떤 model을 사용할지는 정확도에 따라 결정

2017-04-04 42