UNIST(유니스트)
NaturalScience Mathematical Sciences Kyunghoon Kim
자연과학부 수리과학과 김경훈
기본적인 네트워크 분석
Python Library NetworkX Tutorial Korean Version
http://www.pycon.kr/2014/program/7
Slideshare View 창에서는 슬라이드의 링크들이 모두 적용되지 않는 것 같습니다.
Save 하셔서 보시면 모든 링크들을 사용하실 수 있습니다.
This tutorial will provide you with a basic understanding of graph database technology and the ability to quickly begin development of a graph database application. You will have the capability to recognize graph-based problems and present the benefits of using graph technology for problem resolution.
The tutorial will give you an understanding of:
• Graph theory - origins and concepts
• Benefits of graph databases
• Different types of graph databases
• Typical graph database API
• Programming basics
• Use cases
Bring your laptops for a hands-on opportunity to practice some sample codes. A basic understanding of Java programming is a recommended prerequisite to understand this course. This session is led by the InfiniteGraph technical team and the demonstration code will be drawn from InfiniteGraph examples, however the broader educational presentation is product-neutral and not a commercial presentation of their products.
To participate in the hands-on portion of the graph tutorial users must have:
• Java programming experience
• Java Developer Kit (JDK)
• Current InfiniteGraph installed on laptop. (To download visit www.objectivity.com/infinitegraph)
• HelloGraph test – Upon installing IG, run HelloGraph to test the install. (HelloGraph can be found online at http://wiki.infinitegraph.com/2.1/w/index.php?title=Download_Sample_Code)
Leon Guzenda was one of the founding members of Objectivity in 1988 and one of the original architects of Objectivity/DB. He currently works with Objectivity's major customers to help them effectively develop and deploy complex applications and systems that use the industry's highest-performing, most reliable DBMS technology, Objectivity/DB. He also liaises with technology partners and industry groups to help ensure that Objectivity/DB remains at the forefront of database and distributed computing technology. Leon has more than 35 years experience in the software industry. At Automation Technology Products, he managed the development of the ODBMS for the Cimplex solid modeling and numerical control system. Before that, he was Principal Project Director for International Computers Ltd. in the United Kingdom, delivering major projects for NATO and leading multinationals. He was also design and development manager for ICL's 2900 IDMS product. He spent the first 7 years of his career working in defense and government systems. Leon has a B.S. degree in Electronic Engineering from the University of Wales.
Apache MXNet은 매우 빠르게 성장하고 있는 딥러닝 오픈소스 프레임워크로 클라우드, 엣지 디바이스 및 모바일 분야에서 각광을 받고 있습니다. 아마존, NVIDIA, 인텔, 삼성전자 등 500여 명의 공헌자들이 MXNet 커뮤니티에서 활동하고 있습니다. 본 세션에서는 MXNet에 대한 소개와 특징, 그리고 인공 지능 및 기계 학습에 관심이 많은 대학생 및 데이터 과학자, 개발자를 위한 코드 공헌 경험 및 방법을 소개합니다.
This tutorial will provide you with a basic understanding of graph database technology and the ability to quickly begin development of a graph database application. You will have the capability to recognize graph-based problems and present the benefits of using graph technology for problem resolution.
The tutorial will give you an understanding of:
• Graph theory - origins and concepts
• Benefits of graph databases
• Different types of graph databases
• Typical graph database API
• Programming basics
• Use cases
Bring your laptops for a hands-on opportunity to practice some sample codes. A basic understanding of Java programming is a recommended prerequisite to understand this course. This session is led by the InfiniteGraph technical team and the demonstration code will be drawn from InfiniteGraph examples, however the broader educational presentation is product-neutral and not a commercial presentation of their products.
To participate in the hands-on portion of the graph tutorial users must have:
• Java programming experience
• Java Developer Kit (JDK)
• Current InfiniteGraph installed on laptop. (To download visit www.objectivity.com/infinitegraph)
• HelloGraph test – Upon installing IG, run HelloGraph to test the install. (HelloGraph can be found online at http://wiki.infinitegraph.com/2.1/w/index.php?title=Download_Sample_Code)
Leon Guzenda was one of the founding members of Objectivity in 1988 and one of the original architects of Objectivity/DB. He currently works with Objectivity's major customers to help them effectively develop and deploy complex applications and systems that use the industry's highest-performing, most reliable DBMS technology, Objectivity/DB. He also liaises with technology partners and industry groups to help ensure that Objectivity/DB remains at the forefront of database and distributed computing technology. Leon has more than 35 years experience in the software industry. At Automation Technology Products, he managed the development of the ODBMS for the Cimplex solid modeling and numerical control system. Before that, he was Principal Project Director for International Computers Ltd. in the United Kingdom, delivering major projects for NATO and leading multinationals. He was also design and development manager for ICL's 2900 IDMS product. He spent the first 7 years of his career working in defense and government systems. Leon has a B.S. degree in Electronic Engineering from the University of Wales.
Apache MXNet은 매우 빠르게 성장하고 있는 딥러닝 오픈소스 프레임워크로 클라우드, 엣지 디바이스 및 모바일 분야에서 각광을 받고 있습니다. 아마존, NVIDIA, 인텔, 삼성전자 등 500여 명의 공헌자들이 MXNet 커뮤니티에서 활동하고 있습니다. 본 세션에서는 MXNet에 대한 소개와 특징, 그리고 인공 지능 및 기계 학습에 관심이 많은 대학생 및 데이터 과학자, 개발자를 위한 코드 공헌 경험 및 방법을 소개합니다.
[소스 코드]
https://github.com/henlix/data-structure.git
[설명]
대학생 연합 IT 벤처 창업 동아리 S.O.P.T (Shout Our Passion Together - http://sopt.org) 에서 내부적으로 진행하는 전공 과목 기초 스터디 자료입니다.
이번주에 다룰 내용은 전반적인 개요, 복잡도 분석 및 기초 데이터 구조인 배열과 연결리스트 기초입니다.
스터디 자료는 다음과 같은 순서대로 올라갈 예정입니다.
1. 데이터 구조 및 알고리즘
2. 운영체제
3. 네트워크
Next Normal - Humans and AI Collaborate: Toron AI and AI Perfumer
일시:❍ 2024.2.1.(목), 14:00~16:00
장소: 판교 테크노밸리 산업수학혁신센터 세미나실
경기 성남시 수정구 대왕판교로 815, 기업지원허브 231호 국가수리과학연구소
무료주차는 2시간 지원됩니다.
발표자: 김경훈 대표(코어닷투데이)
최근 인공지능(AI) 기술의 발전은 기존에 상상조차 하지 못했던 창의적이고 혁신적인 가능성을 제시하고 있습니다. 특히 생성형 AI는 텍스트, 이미지, 시계열 등 다양한 데이터 분야에서 인간과 유사한 창조력을 발휘하며 놀라운 성과를 이루고 있습니다. 이러한 맥락에서, 본 강연은 두 개의 발전된 AI 시스템, 토론 AI 김컴재와 AI 조향사 센트리아를 중심으로, 생성형 AI의 현재 상황과 미래에 대해 논의하며, 다음의 두 가지 사항을 고려합니다. 첫째, 토론 AI 김컴재와 AI 조향사 센트리아의 대화와 토론을 통해 생성형 AI가 우리 사회와 산업에 미치는 영향과 가능성을 탐색합니다. 이를 통해 생성형 AI의 기술적 진보와 그로 인해 생겨난 새로운 기회를 이해합니다. 둘째, 생성형 AI의 윤리적, 사회적 측면에 대해 조명합니다. 무엇보다 생성형 AI의 발전이 미치는 영향과 이에 대한 사회적 대응은 무엇보다 중요한 논의 주제입니다. 이를 통해 생성형 AI의 위험과 제약사항, 그리고 이를 극복하기 위한 방안을 탐색합니다. 본 강연은 생성형 AI의 미래를 선도할 기술적 혁신과 사회적 대응 방안을 고민해 보고, 유익한 통찰과 함께 뜻깊은 논의의 기회를 제공합니다.
How the machine understands Korean
기계와 대화를 하려면 어떻게 해야 할까요? 우리는 그 동안 기계가 이해할 수 있는 프로그래밍 언어를 만들어서, 그 언어를 통해 소통해 왔습니다. 하지만 2010년 들어서며 급물살을 탄 AI 연구는 이러한 소통의 영역까지 침투하여, 기계가 인간의 언어를 이해하고, 소통할 수 있는 단계로 다가서고자 노력하고 있습니다. 그 근간에는 선형대수학의 여러 이론들이 사용되고 있는데요, 특히 인간의 언어를 기호화하고 이를 벡터공간에 투영하는 방법들이 핵심으로 여겨지고 있습니다. 이러한 방법을 임베딩(embedding)이라 지칭하고, 단어부터 문장, 문서에 이르기까지 인간의 언어를 다양한 형태로 벡터화하고, 이를 이용해 언어의 의미 유사성, 관계 유사성 등을 벡터 공간에서 벡터 연산을 통해 내재적인 의미를 도출합니다.
이번 세미나에서는 벡터공간모델(Vector Space Model, VSM)의 전통적인 방법(TF-IDF, SVD 등)부터 신경망 방법(word2vec, sent2vec 등)에 이르는 다양한 언어 모델링들을 살펴보고, 이를 한국어에 적용했을 때 기계가 어떻게 의미를 이해하는 것으로 해석할 수 있는지 다양한 관점에서 실험을 통해 살펴보도록 하겠습니다.
신문이나 뉴스를 보다보면 본 적이 없다고 할 수 없는 게 인공지능이란 단어가 아닌가 싶습니다. 인공지능이 이렇게 대두되기 까지는 기계학습, 얕은학습, 깊은학습 등이 혼재 되어 그 성장을 이끌었다고 할 수 있습니다. 이번 발표에서는 그러한 개념들에 대한 특징과 연결고리, 구분되는 차이점에 대해 이해하고, 그간의 발전해 온 애플리케이션들을 살펴봅니다. 특히, 기계학습에서 다섯 종족(Tribes)이라 불리는 기호주의자(Symbolists), 연결주의자(Connectionists), 진화주의자(Evolutionaries), 베이즈 주의자(Bayesians), 유추주의자(Analogizers)의 철학과 성격을 살펴보고, 각 종족이 갖는 영향력을 논의합니다. 또한 인공지능을 4단계로 구분하여, 기계를 학습시키는 연구들이 어떻게 인공지능에 받아들여 졌는지 지능과 관련지어 논의해 보겠습니다. 이후 시간이 허락한다면 앞으로의 인공지능의 발전 방향과 예측되는 불확실한 미래에 대해 논의할 예정입니다.
Naive bayes Classification using Python3Kyunghoon Kim
If the text on the screen of slideshare is broken, please download the PDF.
Chapter 1. Bayes Rule
Chapter 2. Classification
Chapter 3. Bayes & Classification
Chapter 4. Naive Bayes Classification
If the text on the screen of slideshare is broken, please download the PDF.
Chapter 1. Drawing / Matplotlib
- Ex1. Temperature graph
Chapter 2. Bayes Rule
- Ex1. A Family with two children
- Ex2. Testing for a rare disease
- Ex3. M&M problem
- Ex4. Monty Hall problem
[20160813, PyCon2016APAC] 뉴스를 재미있게 만드는 방법; 뉴스잼Kyunghoon Kim
https://www.pycon.kr/2016apac/program/1
How to make news fun?
Slideshare의 폰트 인식 문제로 인해 위 파일은 이미지 PDF로 업로드 되어 있습니다.
텍스트가 선택되는 PDF의 다운로드는 아래 링크를 이용하세요.
https://github.com/pythonkr/pyconapac-2016-files/raw/master/20160813-101-1-KimKyunghoon.pdf
1. NetworkX를 이용한 네트워크 분석
김경훈
유니스트 수리과학과
kyunghoon@unist.ac.kr
2014년 8월 30일
숙명여자대학교 창학관 젬마홀
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 1 / 94
2. 이번 TALK의 목적
1 LaTeX
2 점과 선의 자유로움
3 파이썬이라서 자유로운 점
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 2 / 94
3. About me
Speaker
김경훈 (대학원생)
UNIST (Ulsan National Institute of Science and Technology)
자연과학부 수리과학과
Lab
Adviser : Bongsoo Jang
Homepage : http://amath.unist.ac.kr
“Be the light that shines the world with science and technology.”
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 3 / 94
4. 목차
1 네트워크?
2 네트워크 그리기
3 네트워크 계산
4 데모
드라마 네트워크
프로그래밍 언어 네트워크
페이스북 친구 네트워크
5 기타 기능
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 4 / 94
5. 네트워크?
데이터 추상화
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 5 / 94
6. 네트워크?
데이터 추상화
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 6 / 94
7. 네트워크?
데이터 추상화
http://en.wikipedia.org/wiki/K%C3%B6nigsberg
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 7 / 94
8. 네트워크?
데이터 추상화
http://en.wikipedia.org/wiki/K%C3%B6nigsberg
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 8 / 94
9. 네트워크?
데이터 추상화
http://en.wikipedia.org/wiki/K%C3%B6nigsberg
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 9 / 94
10. 네트워크?
데이터 추상화
http://en.wikipedia.org/wiki/K%C3%B6nigsberg
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 10 / 94
11. 네트워크?
데이터 추상화
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 11 / 94
12. 네트워크?
>>> G = nx.MultiGraph()
>>> G.add_nodes_from([‘A’,‘B’,‘C’,‘D’])
>>> G.add_edges_from([(‘A’,‘B’),(‘A’,‘B’),(‘A’,‘D’),(‘B’,‘D’)
,(‘B’,‘C’),(‘B’,‘C’),(‘C’,‘D’)])
>>> nx.draw(G)
>>> plt.show()
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 12 / 94
13. 네트워크?
네트워크 노드(Node) 엣지(Edge)
인터넷 네트워크 컴퓨터 케이블
월드와이드웹 웹 페이지 하이퍼링크
인용 네트워크 글 인용
전력망 발전기 전선
친구 네트워크 사람 친구관계
신진대사 네트워크 대사 산물 반응
신경망 뉴런 시냅스
먹이사슬 네트워크 종 포식
표: 네트워크 예제
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 13 / 94
14. NetworkX : Python Library
NetworkX is a Python language software package for the creation,
manipulation, and study of the structure, dynamics, and functions of
complex networks.
Features
1 무방향성, 방향성, 다중그래프 등의 데이터 구조
2 Nodes can be ”anything” (e.g. text, images, XML records)
3 Edges can hold arbitrary data (e.g. weights, time-series)
4 표준적인 그래프 알고리즘.
5 BSD 라이센스
6 Well tested: more than 1800 unit tests
7 PYTHON LIBRARY!
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 14 / 94
15. NetworkX 설치방법
수동 설치
https://pypi.python.org/pypi/networkx/
자동 설치
easy install networkx
pip install networkx
sudo apt-get install python-networkx
통합 설치
Enthought Canopy
Continuum Analytics Anaconda
Python(x,y)
WinPython
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 15 / 94
16. 네트워크의 간단한 예
>>> import networkx as nx % 라이브러리를 nx로 불러오기
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 16 / 94
17. 네트워크의 간단한 예
>>> import networkx as nx % 라이브러리를 nx로 불러오기
>>> import matplotlib.pyplot as plt % plt로 불러오기
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 17 / 94
18. 네트워크의 간단한 예
>>> import networkx as nx % 라이브러리를 nx로 불러오기
>>> import matplotlib.pyplot as plt % plt로 불러오기
>>> G = nx.Graph() % 빈 그래프 구조 G 생성
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 18 / 94
19. 네트워크의 간단한 예
>>> import networkx as nx % 라이브러리를 nx로 불러오기
>>> import matplotlib.pyplot as plt % plt로 불러오기
>>> G = nx.Graph() % 빈 그래프 구조 G 생성
>>> G.add_edge(1,2) % 엣지 추가
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 19 / 94
20. 네트워크의 간단한 예
>>> import networkx as nx % 라이브러리를 nx로 불러오기
>>> import matplotlib.pyplot as plt % plt로 불러오기
>>> G = nx.Graph() % 빈 그래프 구조 G 생성
>>> G.add_edge(1,2) % 엣지 추가
>>> nx.draw(G) % 그래프 G 그리기
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 20 / 94
21. 네트워크의 간단한 예
>>> import networkx as nx % 라이브러리를 nx로 불러오기
>>> import matplotlib.pyplot as plt % plt로 불러오기
>>> G = nx.Graph() % 빈 그래프 구조 G 생성
>>> G.add_edge(1,2) % 엣지 추가
>>> nx.draw(G) % 그래프 G 그리기
>>> plt.show() % pyplot으로 보여주기
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 21 / 94
22. 노드를 정의하는 방법
>>> G = nx.Graph()
>>> G.add_node(‘apple’) % 노드 ‘apple’ 추가
>>> G.add_nodes_from([‘banana’,‘kiwi’,‘mango’])
% 리스트로 추가 1
or
>>> fruits = [‘banana’,‘kiwi’,‘mango’]
>>> G.add_nodes_from(fruits) % 리스트로 추가 2
>>> G.nodes() % 노드들 보기
[‘apple’, ‘kiwi’, ‘mango’, ‘banana’]
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 22 / 94
23. 엣지를 정의하는 방법
>>> G = nx.Graph()
>>> G.add_edge(‘apple’, ‘banana’) % ‘apple’과 ‘banana’의 관계(엣지) 추가
>>> G.add_edges_from([(‘apple’,‘mango’),(‘apple’,‘kiwi’)])
% 리스트로 추가 1
or
>>> relations = [(‘apple’,‘mango’),(‘apple’,‘kiwi’)]
>>> G.add_edges_from(relations) % 리스트로 추가 2
>>> G.edges() % 엣지들 보기
[(‘apple’, ‘banana’), (‘kiwi’, ‘apple’), (‘mango’, ‘apple’)]
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 23 / 94
28. 네트워크 그리기
네트워크가 정의되기 위해서는?
점(Objects, Vertices, Nodes, Sites, Actors, ...)
선(Relations, Edges, Links, Bonds, Ties, ...)
+
점의 위치
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 28 / 94
29. 네트워크 그리기
>>> G = nx.Graph()
>>> relations = [(‘apple’, ‘banana’), (‘kiwi’, ‘apple’),
(‘mango’, ‘apple’)]
>>> G.add_edges_from(relations) % 점, 선 생성
>>> nx.draw(G) % 점의 위치를 spring layout으로 생성
>>> plt.show()
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 29 / 94
30. 네트워크 그리기
>>> nx.draw(G) % 기본 그리기
>>> nx.draw_circular(G) % 원 위에 노드 놓기
>>> nx.draw_graphviz(G) % Graphviz 사용
>>> nx.draw_random(G) % 균등 분포를 이용한 랜덤
>>> nx.draw_shell(G) % 동심원 위에 노드 놓기
>>> nx.draw_spectral(G) % 그래프 라플라시안의 고유 벡터 기반
>>> nx.draw_spring(G) % Fruchterman-Reingold force-directed alg. 기반
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 30 / 94
38. Degree에 따른 노드의 크기 변화
>>> relations = [(‘kiwi’, ‘apple’), (‘mango’, ‘apple’),
(‘apple’, ‘banana’)]
>>> G.add_edges_from(relations)
>>> degree = nx.degree(G)
>>> nx.draw(G, node_size=[v*1000 for v in degree.values()])
>>> plt.show()
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 38 / 94
48. 네트워크 ⇒ 행렬 ⇒ ?3
0 0 1 0
0 0 1 0
1 1 0 1
0 0 1 0
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 48 / 94
49. 행렬의 고유값, 고유벡터
>>> A = nx.to_numpy_matrix(G)
>>> [w,v]=np.linalg.eig(A)
>>> w # eigenvalues
array([ -1.73205081e+00, 1.79977561e-17, 1.73205081e+00,
0.00000000e+00])
>>> v # normalized eigenvectors
matrix([[ 4.08248290e-01, -8.16496581e-01, 4.08248290e-01,
0.00000000e+00],
[ 4.08248290e-01, 4.08248290e-01, 4.08248290e-01,
-7.07106781e-01],
[ -7.07106781e-01, 9.45046688e-17, 7.07106781e-01,
0.00000000e+00],
[ 4.08248290e-01, 4.08248290e-01, 4.08248290e-01,
7.07106781e-01]]) 김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 49 / 94
50. 고유벡터 중심성
>>> nx.eigenvector_centrality(G)
Traceback (most recent call last)
File <stdin>, line 1, in <module>
File eigenvector.py, line 103, in eigenvector_centrality
power iteration failed to converge in %d iterations.
networkx.exception.NetworkXError eigenvector_centrality():
power iteration failed to converge in %d iterations.%(i+1)
내용 설명 링크 58페이지
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 50 / 94
51. NetworkX 내용 정리
데이터 추상화
객체(노드)와 관계(엣지)의 자유로운 정의
import networkx as nx
G = nx.Graph()
노드, 엣지 추가
노드, 엣지 속성 부여
네트워크 그리기
행렬 아이디어 ?1, ?2, ?3
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 51 / 94
52. 데모
1 드라마 네트워크
2 프로그래밍 언어 네트워크
3 페이스북 네트워크
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 52 / 94
53. 드라마 대본을 이용한 네트워크
부산과학고등학교 2014 R&E
연구자 : 권기영, 김채린, 배지환, 이가영, 한송미
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 53 / 94
54. 드라마 대본을 이용한 네트워크
한국콘텐츠진흥원 KOCCA 방송대본데이터베이스
http://db.kocca.kr/db/bbs/read/broadcastdb.do?nttNo=1931073
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 54 / 94
55. 드라마 대본을 이용한 네트워크
동시 출현성 (Co-Occurrence)
객체(노드) : 등장인물
관계(엣지) : 같은 문장 내에 등장하는 인물들
그래. 아깐 정말 폭풍전야 같았어. 장철수는 이제 안나한테 죽~었어~!!
장철수 - 안나
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 55 / 94
56. 드라마 대본을 이용한 네트워크
동시 출현성 (Co-Occurrence)
객체(노드) : 등장인물
관계(엣지) : 화자(말하는 사람)가 언급하는 인물
빌리 : 그래. 아깐 정말 폭풍전야 같았어. 장철수는 이제 안나한테 죽~었어~!!
빌리 - 장철수
빌리 - 안나
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 56 / 94
57. 드라마 대본을 이용한 네트워크
노드(Node)와 엣지(Edge)는
어떤 것도 될 수 있다!
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 57 / 94
58. 드라마 대본을 이용한 네트워크
씬/45 철수집 거실 (D)
철수 화장실 나와서
‘전화가 왜 이렇게 돼 있냐,,’ 툭 올려 두고, ‘근데 내 핸드폰 어딨냐,,’ 찾는데
안나 핸드폰 꽂아 둔 쇼파위에 깔고 앉는다.
안나 : 꼬시다 꽃다발.. (썩소 하는데)
철수 : (나두고 가지뭐,,) 나 나간다. 애들 밥 챙겨라. (하고)
안나 : 에씨.. 왜 또 기어나가는 거야. 지금 가면 꽃다발 만날 텐데..
씬/46 철수마당 (D)
철수 나가는데 안나 나오며 ‘장철수~’
철수 보면
안나 : 꽃순이 집이 부서진 거 같던데, 봤어? 고쳐 주고 가.
철수 : 꽃순이가 일부러 부서논 거야. (가면)
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 58 / 94
59. 드라마 대본을 이용한 네트워크
동시 출현성 (Co-Occurrence)
객체(노드) : 등장인물
관계(엣지) : 같은 씬에 등장하는 인물들
s = read(filename)
contents = s.split(‘씬/’)
for content in contents:
...
G.add_edge(등장인물1, 등장인물2)
...
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 59 / 94
60. 드라마 대본을 이용한 네트워크
degree = nx.degree(G).values()
nx.draw(G, node_size=[v*1000 for v in degree], font_size=30)
plt.show()
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 60 / 94
61. 드라마 대본을 이용한 네트워크
Network Information
print "Number of Nodes : ", nx.number_of_nodes(G)
print "Number of Edges : ", nx.number_of_edges(G)
degreelist = list(G.degree().values())
print "Avg. Node Degree : ", float(sum(degreelist))/nx.number_of_nodes(G)
print "Avg. Path Length : ", nx.average_shortest_path_length(G)
print "Avg. Clustering Coefficient : ", nx.average_clustering(G)
Number of Nodes : 16
Number of Edges : 38
Avg. Node Degree : 4.75
Avg. Path Length : 1.775
Avg. Clustering Coefficient : 0.765340909091
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 61 / 94
62. 드라마 대본을 이용한 네트워크
Network Information
print "::: Betweenness Centrality"
x = nx.betweenness_centrality(G)
sorted_list = sorted(x.iteritems(), key=operator.itemgetter(1), reverse=True)
for s in sorted_list[:20]:
print s[0], s[1]
::: Betweenness Centrality
안나 0.400793650794
철수 0.328571428571
빌리 0.0944444444444
계주 0.0571428571429
강자 0.00238095238095
덕구 0.00238095238095
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 62 / 94
63. 드라마 대본을 이용한 네트워크
Network Information
print "::: Closeness Centrality"
x = nx.closeness_centrality(G)
sorted_list = sorted(x.iteritems(), key=operator.itemgetter(1), reverse=True)
for s in sorted_list[:20]:
print s[0], s[1]
::: Closeness Centrality
안나 0.833333333333
철수 0.833333333333
빌리 0.625
계주 0.6
근석 0.576923076923
일동 0.576923076923
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 63 / 94
64. 드라마 대본을 이용한 네트워크
참고자료
언어 네트워크 분석으로 신뢰-비신뢰 요인 한눈에 본다
공공앱의 사용자 리뷰에 대한 분석 : 언어네트워크분석을 중심으로
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 64 / 94
65. 드라마 대본을 이용한 네트워크
참고자료
언어 네트워크 분석으로 신뢰-비신뢰 요인 한눈에 본다
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 65 / 94
66. 드라마 대본을 이용한 네트워크
참고자료
언어 네트워크 분석으로 신뢰-비신뢰 요인 한눈에 본다
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 66 / 94
67. 드라마 대본을 이용한 네트워크
참고자료
공공앱의 사용자 리뷰에 대한 분석 : 언어네트워크분석을 중심으로
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 67 / 94
68. 드라마 대본을 이용한 네트워크
한국어 대사 분석 방법
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 68 / 94
69. 프로그래밍 언어 네트워크
Document :
http://brendangriffen.com/gow-programming-languages/
Python :
https://github.com/bgriffen/griffsgraphs/blob/master/programminglanguages/proglanguages.py
Dataset :
https://github.com/bgriffen/griffsgraphs/tree/master/programminglanguages/data/languages
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 69 / 94
70. 프로그래밍 언어 네트워크
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 70 / 94
71. 프로그래밍 언어 네트워크
Node Size = Degree
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 71 / 94
72. 프로그래밍 언어 네트워크
Node Size = PageRank
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 72 / 94
73. 프로그래밍 언어 네트워크
웹 크롤링 방법
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 73 / 94
74. 페이스북 친구 네트워크
Netvizz
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 74 / 94
75. 페이스북 친구 네트워크
Netvizz
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 75 / 94
76. 페이스북 친구 네트워크
Netvizz
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 76 / 94
77. 페이스북 친구 네트워크
Netvizz
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 77 / 94
78. 페이스북 친구 네트워크
페이스북 네트워크 with Degree Centrality
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 78 / 94
79. 페이스북 친구 네트워크
페이스북 네트워크 with Betweenness Centrality
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 79 / 94
80. Gephi로 네트워크 그리기
Gephi with CSV File
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 80 / 94
81. 기타 기능
파일 내보내기
파일 불러오기
노드의 한글 표현 방법
네트워크의 링크 예측
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 81 / 94
82. 파일 내보내기
nx.write_graphml(G, ‘./graphfile.graphml’)
nx.write_gexf(G, ‘파일 경로’)
nx.write_gml
nx.write_yaml
nx.write_pajek
nx.write_shp
nx.dump # for JSON
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 82 / 94
83. 파일 불러오기
nx.read_graphml(‘./graphfile.graphml’, unicode)
nx.read_gexf(G, ‘파일 경로’)
nx.read_gml
nx.read_yaml
nx.read_pajek
nx.read_shp
nx.load # for JSON
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 83 / 94
84. 노드의 한글 표현 방법
방법1. nx pylab.py의 수정
/usr/lib/pymodules/python2.7/networkx/drawing/nx_pylab.py
C:Anaconda32Libsite-packagesnetworkxdrawingnx_pylab.py
수정 방법 : https://gist.github.com/koorukuroo/3aae9a3e900e868840ea
수정된 코드 : https://gist.github.com/koorukuroo/5efb58a86c5396f13650
사용방법
import matplotlib.font_manager as fm
fp1 = fm.FontProperties(fname="./NotoSansKR-Regular.otf")
# 무료 폰트 https://www.google.com/get/noto/pkgs/NotoSansKorean-windows.zip
nx.set_fontproperties(fp1)
G = nx.Graph()
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 84 / 94
85. 네트워크의 링크 예측
대구과학고등학교 2014 R&E
연구자 : 김요한, 김현, 유주형, 유준승, 한승원
L¨u, Linyuan, and Tao Zhou. "Link prediction in complex networks: A survey." Physica A(2011): 1150-1170.
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 85 / 94
86. 네트워크의 링크 예측
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 86 / 94
87. 네트워크의 링크 예측
NetworkX 버전 업그레이드
pip install --upgrade networkx==1.9
pip install --upgrade git+https://github.com/networkx/networkx.git#egg=networkx
http://networkx.github.io/documentation/latest/install.html
To be continue(?)
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 87 / 94
88. Appendix1. KLDP 개발자 네트워크
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 88 / 94
89. Appendix1. KLDP 개발자 네트워크
http://dspace.kaist.ac.kr/handle/10203/21356
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 89 / 94
90. Appendix1. KLDP 개발자 네트워크
http://dspace.kaist.ac.kr/handle/10203/21356
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 90 / 94
91. Appendix2. 점과 선의 체인지
SBS 시크릿가든 공식 홈페이지
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 91 / 94
92. Appendix2. 점과 선의 체인지
Lim, Sungsu, et al. "LinkSCAN*: Overlapping community detection using the link-space transformation."
Data Engineering (ICDE), 2014 IEEE 30th International Conference on. IEEE, 2014.
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 92 / 94
93. Appendix3. Predict Ebola’s Spread
http://www.technologyreview.com/news/530296/cell-phone-data-might-help-predict-ebolas-spread/
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 93 / 94
94. 이번 TALK의 목적 (다시 확인)
1 LaTeX
2 점과 선의 자유로움
3 파이썬이라서 자유로운 점
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 94 / 94
95. The End
김경훈 (UNIST) NetworkX with Network Analysis 2014년 8월 30일 95 / 94