Machine Learning/[Kaggle Course] Data Visualization

[Kaggle Course] Choosing Plot Types and Custom Styles

WakaraNai 2020. 11. 16. 23:11
728x90
반응형

 

Plot Type 선택 전 고려할 사항  

 

  1. Trends == parttern of change(변화의추이를보고싶을때)
    • sns.lineplot
      • Line charts는 일정 기간 동안의 추세를 보여줄 때 적합.
      • 여러 line을 그려서 둘 이상의 그룹에서도 추세를 보여줄 수 있음.
  2. Relationship == data와 variables 사이의 relationship 이해하기
    • sns.barplot
      • Bar charts는 서로 다른 그룹이 공통적으로 갖는, 한 가지 물질의 양을 비교하기에 적합. 
    • sns.heatmap 
      • Heatmaps는 각 cell마다 수치와 color-coded pattern을 사용할 수 있다는 장점.
    • sns.scatterplot
      • Scatter plots은 연속적인(continuous) 두 변수 사이의 관계를 보여줌.
      • color-coded 적용 시, 제 3의 categorical variable과의 관계로 보여줌.
    • sns.regplot
    • sns.lmplot
      • regression line을 여러 개 그려야 할 때 적합. 특히 scatter plot이 많은 color-coded groups를 가질 때
    • sns.swarmplot
  3. Distribution == 그 변수들이 가리키는, 보여주는 분포를 시각화
    • sns.distplot
      • Histograms은 single numerical variable의 분포를 보여주기에 적합
    • sns. kdeplot
      • KDE plots (or 2D KDE plots)는 추정되는 분포를 부드럽게(곡선으로) 표현
      • 그 분포는 single numerical variable도, (or two numerical varibles)에서도 적용 가능
    • sns.jointplot
      • 각기 다른 변수마다 개별적으로 KDE plot을 그리지 않고, 동시에 보여주기 위해, 
      • 2D KDE plot을 그려주는 command.

 

 

 

Changing/Customizing Styles with Seaborn

1. 그래프의 figure에 대해서

  • 크기 : plt.figure(figsize=(12,6))
  • 배경색 : sns.set_style("dark")
    • 종류 - "darkgrid", "whitegrid", "dark", "white", "ticks"

 

 

 

728x90
반응형