[Data Science] Bokeh를 활용한 대화형 웹 시각화
Bokeh를 활용한 대화형 웹 시각화 # bokeh 설치 conda install bokeh import numpy as np from bokeh.io import output_notebook, show from bokeh.plotting import figure output_notebook() p = figure(plot_width=400, plot_height=400) x = [1,2,3,4,5] y = [6,7,2,4,5] p.circle(x, y, size=15, line_color='navy', fill_color='orange', fill_alpha=0.5) show(p) HTML 파일로 추출 import bokeh # 샘플 데이터 다운로드 bokeh.sampledata.download() i..
2022. 10. 26.
[Data Science] 문서의 행렬 표현 (DTM and TF-IDF)
CountVectorizer를 이용한 토큰화 import sklearn print(sklearn.__version__) from sklearn.feature_extraction.text import CountVectorizer vector = CountVectorizer() text = ['Text mining, also referred to as text data mining, similar to text analytics, is the process of deriving high-quality information from text.'] vector.fit_transform(text).toarray() array([[1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4,..
2022. 9. 29.