SlideShare a Scribd company logo
1 of 83
Download to read offline
창조 데이터
데이터 수집, 어디까지 해봤니?
김태준 (Jun Kim)
i2r.jun@gmail.com
데이터야놀자
2017. 10. 13.
창조에 가까운 데이터 수집 X고생 이야기, 지금 시작합니다.
— University of South Florida, 권창현 교수님
“연구란 뭘 하는지도 모르면서 뭔가 열심히 하다가,
수많은 과정을 거쳐서,
결국에는 새로운 지식을 얻게 되는 과정이다.”
대학원생 때 알았더라면 좋았을 것들, http://gradschoolstory.net/
— University of South Florida, 권창현 교수님
“연구란 뭘 하는지도 모르면서 뭔가 열심히 하다가,
수많은 과정을 거쳐서,
결국에는 새로운 지식을 얻게 되는 과정이다.”
대학원생 때 알았더라면 좋았을 것들, http://gradschoolstory.net/
— University of South Florida, 권창현 교수님
“연구란 뭘 하는지도 모르면서 뭔가 열심히 하다가,
수많은 과정을 거쳐서,
결국에는 새로운 지식을 얻게 되는 과정이다.”
대학원생 때 알았더라면 좋았을 것들, http://gradschoolstory.net/
노가다
뻘짓
삽질
안녕하세요, 김태준 입니다!
• 서울시립대학교 데이터마이닝 연구실 석사과정

• 연구원들과 함께 연구하며 수많은 노가다/뻘짓/삽질 경험

• 데이터야놀자 발장 (발표자들의 장)

• 데이터야놀자 BGM 담당

• 데이터야 “제플린이랑” 놀자 조교
저는
물 화재 발생 예측
구를 합니다
2년간
화재 사건 데이터수집을 위한
피나는
노오오오오오오력!
지금 시작합니다.
2년전..
“데이터마이닝 연구실 가자!!!”
데이터마이닝 연구실인데
데이터가 없다
데이터를 저장하고 처리할
클러스터도 없다…!
대학교 연구실은 (보통)
데이터가 없다
• 사람들은 분석보다 전처리가 오래 걸린다고 한다

• 대학원오면 전처리할 데이터도 없다

- 수집부터 해야됨

• 무엇을 상상하든 수집/전처리는 당신의 상상 이상이다
클러스터를 구축해보자!!!
서버 열대를 준비하고..
포맷 x10
초기 설정
IP 고정, root 계정 설정 등
클러스터 매니저 Apache Ambari 설치
어.. 왜 안되지..
지우고 다시 깔아야겠다 ㅎ
어.. 왜 안지워지지.. 하핫
어.. 왜 안지워지지.. 하핫
나는 그 순간 깨달았다.
이것은 포맷만이 답이라는걸.
다시 포맷 x10
총 포맷 x20
초기 설정
IP 고정, root 계정 설정 등
성공!(일주일동안 하루종일 설치만해서)
(포맷 20번하고)
지금 생각해보면..
• 굉장히 멍청하게 설치함

- 일단 한두대에 설치 후 한대씩 늘려가면됨

• Hadoop eco system이 어떻게 구성되는지 잘 알게됨
그래도 여전히
화재 데이터는 없다
화재 뉴스 기사를 수집해보자!
(분 해봤자 별게 없을 것 같지만)
화재
검색 엔진에 “화재” 검색!
뉴스 기사 수집
삼성화재
동부화재
아니 너네 말고..
화재 -삼성화재 -동부화재
검색 엔진에 “화재 -삼성화재 -동부화재” 검색
뉴스 기사 수집
연예인 X가
마약, 화재
화재 훈련
아니.. 니네도 말고..
그래..!
머신러닝으로
화재 사건과 관 없는 기사를 걸러내자..!
1200개의 뉴스 기사를 일일이 수작업으로 분류
화재
1
비화재
0
화재
1
비화재
0
화재
1
비화재
0…
화재
1
비화재
0
화재
1
비화재
0
화재
1
비화재
0…
러닝러닝
머신러닝
러닝머신
난생처음
머신러닝
너무너무
흥분흥분
수작업으로 분류된 1200개의 뉴스 기사 학습
화재
1
비화재
0
화재
1
비화재
0
화재
1
비화재
0…
화재
1
화재
1
화재
1
화재
1 … 화재
1
화재
1
나머지 십만개의 기사 분류
화재 기사만 남았다!
화재
1
화재
1
화재
1
화재
1 … 화재
1
화재
1
와아아아아아아아!!! 분석해보자!!!
재밌고 좋은 뻘짓이였다
정말 아무것도 없었다.
이걸로 논문을 써보자
????? (뻘짓으로 논문을?)
교수님
랩실
노예
학회
헤헿 받던지 말던지
논문
학회
저도 아는데요;
팩트 폭행 자제 좀..
이 논문은 기여가
없다고 생각해
학회
??? 츤데레인가
그런데 받아는 줄게
— 이화여대 오욱환 교수님
“걸작(傑作)이나 대작(大作)보다
습작(習作)에 충실하십시오.”
학문을 직업으로 삼으려는 젊은 학자들을 위하여, https://sites.google.com/site/jeonggilko/for_young_scientists_oh
— 이화여대 오욱환 교수님
“논문을 쓰지 못하는 학자들의 특징 가운데 하나가 바로
걸작에 대한 집착입니다.”
학문을 직업으로 삼으려는 젊은 학자들을 위하여, https://sites.google.com/site/jeonggilko/for_young_scientists_oh
“그러나 걸작은 쉽게 나오지 않을 뿐만 아니라
걸작을 지향한 논문이라고 해서 걸작이 되는 것도 아닙니다.”
“논문을 쓸 때마다 최선을 다하고
그 논문들이 쌓여지면서
걸작과 대작이 가능해질 뿐입니다.”
데이터야놀자
2016
저 뻘짓했어요!
데이터야놀자
2016
(이 행사 좀 이상한데;;;)
와아아아아아!!!!
최고의 뻘짓!!!
공유하자.
뻘짓 공유는 다른 사람에게 도움이된다.
Spark NKP
한국어 형태소 분석기를 Spark에서 사용하기 쉽게 개발
SparkDay 2017
Spark NKP
잘 쓰고 있습니다!
너무너무
감사감사
뿌듯뿌듯
화재 뉴스 기사 뻘짓 결과
• 첫 머신러닝 논문을 써봄

- SCOPUS 저널 게제

• 데이터야놀자 2016 발표

• Spark 용 한국어 형태소 분석기 Spark NKP 개발
그래도 여전히
화재 데이터는 없다
아.. 어디서 구하지..
모 기관은 “화재현황통계” 서비스를 제공한다.
특정 기간, 지역의 화재 건수, 피해 금액, 건물 용도 등을 알 수 있다.
<검색 결과의 일부>
<검색 결과의 일부>
기간 설정하고 (1년)
<검색 결과의 일부>
소방서 설정하고 검색하면!
<검색 결과의 일부>
화재 기록이 나온다
정말 상세하게 검색할 수 있다.
휘경 119 안전센터는
1년동안 화재가 35건
휘경 119 안전 터는
하루 평균 0.1건의 화재 사건 발생
휘경 소방서 1년 기록 검색
웃긴게 하루 단위로도 검색 가능하다
한 건.
그렇다.
소방서는 하루에 한 번
출동할까 말까이다.
(허위 신고, 화재 사건 이외 출동 제외)
즉, 한 번에 화재 사건 하나씩
, 크롤링할 수 있다.
모든 소방서의
화재 사건 크롤링!
화재 사건 데이터 습득!
하지만 어느 사건이 어느 건물에서 발생한지는 알 수 없다…
건축물대장
전기사용량 가스사용량
인구밀도
건물밀도
화재 사건
…
화재 축물 데이터셋 구상도
하지만 어느 사건이 어느 건물에서 발생한지는 알 수 없다…
건축물대장
전기사용량 가스사용량
인구밀도
건물밀도
화재 사건
…
화재 축물 데이터셋 구상도
이젠 더 이상 두려울게 없다.
온갖 데이터 마이닝 기법으로
화재 사건과 건축물을 매칭해보자!
유한묵
—데이터 매칭 희생자—
10개월 희생
매칭에 사용된 기법들
• Locality sensitive hashing (LSH)

• Deep Neural Network (DNN)

• Generative Adversarial Networks (GAN)

• Semi-supervised Learning

- EM algorithm

• Ensemble
유한묵
매칭 결과
• 서울 화재 사건 17000건을 약 50만개의 건축물과 매칭

• Top-3 accuracy 63% 달성

- 1개의 화재 사건당 3개의 후보 건물을 매칭한 경우 63%의 확률로 3개 중 하나는
맞다
- 1개의 화재 사건을 50만개 중 3개로 매칭해주는 것이라 정말 높은 수치임
• 이 과정이 10개월이 걸림
유한묵
• R 초고수

• Python도 함

• 데이터 집착남

• 데이터 마이닝 지식 풍부

- 데이터분석

- 머신러닝

- 딥러닝

- 키워드 추천

• 하시면 제게 연락주 요..!
⭑유한묵⭑
구 직 중
마지막 학기
건축물대장
전기사용량 가스사용량
인구밀도
건물밀도
화재 사건
…
화재 축물 데이터셋
2년만에..
정확하진 않지만 얼추 비슷한 데이터셋을 얻음
아. 뭐하지.
화재 예측 될리가 없는데.
클러스터링으로
화재 위험군 물을 알아내자!
분석 과정은 대충 설명합니다 ㅎ
Deep Neural Network (DNN)으로 feature transformation
물 화재/비화재
학습하고 나면,
마지막 레이어(8차원)의 output은 좋은 feature를 갖게됨
즉, 클러스터링이 잘된다는 말씀!
클러스터링하기 전에 전처리
8→2차원으로 차원 축소하여 시각화해보자 (feat. t-SNE)
노랑: 화재 물
보라: 비화재 물
Feature transformation 잘 됐네~
2개의 군집으로 클러스터링
화재 군집, 비화재 군집
딱 나뉜다
군집 결과와 실제 label이 다른 건물들 (노랑)
화재 위험군?
두개의 군집을 다시 클러스터링
화재 위험군 일까?
지금은 한 클러스터 내에서
화재/비화재 건물의
공통점은 무엇인지
차이점은 무엇인지
알아내는 연구를 하고 있습니다.
(데이터 수집 완료된지 한달도 안됨;;; 분석해본게 얼마 없음;;;)
— 알베르트 아인슈타인
“If we know what it was we were doing,
it would not be called research, would it?”
(우리도 우리가 뭐하는지 잘 모르잖아요.
알면 연구 아니잖아요. 그렇잖아요.)
대학원생 때 알았더라면 좋았을 것들, http://gradschoolstory.net/
— University of South Florida, 권창현 교수님
“연구란 뭘 하는지도 모르면서 뭔가 열심히 하다가,
수많은 과정을 거쳐서,
결국에는 새로운 지식을 얻게 되는 과정이다.”
대학원생 때 알았더라면 좋았을 것들, http://gradschoolstory.net/
그 유명한 베이즈 정리도
40년 후 주목 받았다.
고지마 히로유키, 세상에서 가장 쉬운 베이즈 통계학 입문, 지상사 (2017)
어느 통계학 책에나 등장하는 t분포 또한
그 당시 별로 주목받지 못했다.
고지마 히로유키, 세상에서 가장 쉬운 통계학 입문, 지상사 (2017)
— University of Seoul, 김태준 학생
“재밌게 뻘짓하자.”
감사합니다.
김태준 (Jun Kim)

i2r.jun@gmail.com

More Related Content

More from Dataya Nolja

How to Study Mathematics for ML
How to Study Mathematics for MLHow to Study Mathematics for ML
How to Study Mathematics for MLDataya Nolja
 
Music Data Start to End
Music Data Start to EndMusic Data Start to End
Music Data Start to EndDataya Nolja
 
Find a Leak Time in the Schedule
Find a Leak Time in the ScheduleFind a Leak Time in the Schedule
Find a Leak Time in the ScheduleDataya Nolja
 
A Financial Company Story of Bringing Open Source and ML in
A Financial Company Story of Bringing Open Source and ML inA Financial Company Story of Bringing Open Source and ML in
A Financial Company Story of Bringing Open Source and ML inDataya Nolja
 
Practice, Practice, Practice and do the Dirty Work
Practice, Practice, Practice and do the Dirty WorkPractice, Practice, Practice and do the Dirty Work
Practice, Practice, Practice and do the Dirty WorkDataya Nolja
 
Predicting People Who May Get off at the Next Station
Predicting People Who May Get off at the Next StationPredicting People Who May Get off at the Next Station
Predicting People Who May Get off at the Next StationDataya Nolja
 
Log Design Case Study
Log Design Case StudyLog Design Case Study
Log Design Case StudyDataya Nolja
 
Let's Play with Data Safely
Let's Play with Data SafelyLet's Play with Data Safely
Let's Play with Data SafelyDataya Nolja
 
Things Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in MindThings Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in MindDataya Nolja
 
Things Happend between JDBC and MySQL
Things Happend between JDBC and MySQLThings Happend between JDBC and MySQL
Things Happend between JDBC and MySQLDataya Nolja
 
Human-Machine Interaction and AI
Human-Machine Interaction and AIHuman-Machine Interaction and AI
Human-Machine Interaction and AIDataya Nolja
 
Julia 0.5 and TensorFlow
Julia 0.5 and TensorFlowJulia 0.5 and TensorFlow
Julia 0.5 and TensorFlowDataya Nolja
 
Zeppelin and Open Source Ecosystem and Silicon Valley
Zeppelin and Open Source Ecosystem and Silicon ValleyZeppelin and Open Source Ecosystem and Silicon Valley
Zeppelin and Open Source Ecosystem and Silicon ValleyDataya Nolja
 
Hadoop 10th Birthday and Hadoop 3 Alpha
Hadoop 10th Birthday and Hadoop 3 AlphaHadoop 10th Birthday and Hadoop 3 Alpha
Hadoop 10th Birthday and Hadoop 3 AlphaDataya Nolja
 
Kakao Bank Powered by Open Sources
Kakao Bank Powered by Open SourcesKakao Bank Powered by Open Sources
Kakao Bank Powered by Open SourcesDataya Nolja
 
Open Source is My Job
Open Source is My JobOpen Source is My Job
Open Source is My JobDataya Nolja
 
Creating Value through Data Analysis
Creating Value through Data AnalysisCreating Value through Data Analysis
Creating Value through Data AnalysisDataya Nolja
 
How to Make Money from Data - Global Cases
How to Make Money from Data - Global CasesHow to Make Money from Data - Global Cases
How to Make Money from Data - Global CasesDataya Nolja
 
Structured Streaming with Apache Spark
Structured Streaming with Apache SparkStructured Streaming with Apache Spark
Structured Streaming with Apache SparkDataya Nolja
 
How to Create Value from Data, and Its Difficulty
How to Create Value from Data, and Its DifficultyHow to Create Value from Data, and Its Difficulty
How to Create Value from Data, and Its DifficultyDataya Nolja
 

More from Dataya Nolja (20)

How to Study Mathematics for ML
How to Study Mathematics for MLHow to Study Mathematics for ML
How to Study Mathematics for ML
 
Music Data Start to End
Music Data Start to EndMusic Data Start to End
Music Data Start to End
 
Find a Leak Time in the Schedule
Find a Leak Time in the ScheduleFind a Leak Time in the Schedule
Find a Leak Time in the Schedule
 
A Financial Company Story of Bringing Open Source and ML in
A Financial Company Story of Bringing Open Source and ML inA Financial Company Story of Bringing Open Source and ML in
A Financial Company Story of Bringing Open Source and ML in
 
Practice, Practice, Practice and do the Dirty Work
Practice, Practice, Practice and do the Dirty WorkPractice, Practice, Practice and do the Dirty Work
Practice, Practice, Practice and do the Dirty Work
 
Predicting People Who May Get off at the Next Station
Predicting People Who May Get off at the Next StationPredicting People Who May Get off at the Next Station
Predicting People Who May Get off at the Next Station
 
Log Design Case Study
Log Design Case StudyLog Design Case Study
Log Design Case Study
 
Let's Play with Data Safely
Let's Play with Data SafelyLet's Play with Data Safely
Let's Play with Data Safely
 
Things Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in MindThings Data Scientists Should Keep in Mind
Things Data Scientists Should Keep in Mind
 
Things Happend between JDBC and MySQL
Things Happend between JDBC and MySQLThings Happend between JDBC and MySQL
Things Happend between JDBC and MySQL
 
Human-Machine Interaction and AI
Human-Machine Interaction and AIHuman-Machine Interaction and AI
Human-Machine Interaction and AI
 
Julia 0.5 and TensorFlow
Julia 0.5 and TensorFlowJulia 0.5 and TensorFlow
Julia 0.5 and TensorFlow
 
Zeppelin and Open Source Ecosystem and Silicon Valley
Zeppelin and Open Source Ecosystem and Silicon ValleyZeppelin and Open Source Ecosystem and Silicon Valley
Zeppelin and Open Source Ecosystem and Silicon Valley
 
Hadoop 10th Birthday and Hadoop 3 Alpha
Hadoop 10th Birthday and Hadoop 3 AlphaHadoop 10th Birthday and Hadoop 3 Alpha
Hadoop 10th Birthday and Hadoop 3 Alpha
 
Kakao Bank Powered by Open Sources
Kakao Bank Powered by Open SourcesKakao Bank Powered by Open Sources
Kakao Bank Powered by Open Sources
 
Open Source is My Job
Open Source is My JobOpen Source is My Job
Open Source is My Job
 
Creating Value through Data Analysis
Creating Value through Data AnalysisCreating Value through Data Analysis
Creating Value through Data Analysis
 
How to Make Money from Data - Global Cases
How to Make Money from Data - Global CasesHow to Make Money from Data - Global Cases
How to Make Money from Data - Global Cases
 
Structured Streaming with Apache Spark
Structured Streaming with Apache SparkStructured Streaming with Apache Spark
Structured Streaming with Apache Spark
 
How to Create Value from Data, and Its Difficulty
How to Create Value from Data, and Its DifficultyHow to Create Value from Data, and Its Difficulty
How to Create Value from Data, and Its Difficulty
 

Endless Trial-and-Errors for Data Collecting