본문 바로가기

전체 글

(57)
Text Text Title - 주제 Label - 축의 정보 Tick label - 축의 scale Legend - 범례 Annotation(Text) - 각주 detail color linespacing - 줄 간격 backgroundcolor alpha - 투명도 zorder - 맨앞으로, 맨뒤로 visible alignment va, ha, rotation, multialignment bbox
Scatter plot Scatter plot feature 간 관계를 표현 .scatter() 색, 모양, 크기로 구분 군집, 값 사이의 차이, 이상치 확인 용이 점이 많아질 시 투명도 jottering : 점의 위치 조정 2차원 histogram : 히트맵 사용 contour plot : 등고선 인과 관계 != 상관 관계 추세선은 1개만 사용할 것 grid는 지양, category가 포함됐다면 히트맵, 버블 차트
Line plot Line plot 연속적으로 변화하는 값을 점으로 나타내어 연결한 선 시계열 분석에 특화 .line()이 아닌 .plot() 너무 많은 선은 가독성 하락 색상(color), 마커(marker), 선의 종류(linestyle) noise를 방지하기 위해 smoothing 사용 추세를 보기 위함이므로 축을 0에 둘 필요 x 디테일한 정보는 생략 간격을 규칙적으로 표기, 불규칙적이라면 점 찍어 표기 점과 점 사이에 데이터를 잇는 방법(보간) error나 noise를 처리, smoothing 이중 축 - 같은 시간 축에 다른 데이터를 표현 line의 끝에 label 표시, min/max 등 annotation 표시 uncertainty 표현
Bar plot Bar plot category에 따른 값을 비교하기에 적절 .bar , .barh(그래프를 옆으로 눕힘) Stacked Bar plot 각 그룹을 쌓아서 표현 모든 그룹의 순서는 일정해야 함 전체에서 비율을 나타내는 percentage stacked bar chart Overlapped Bar plot 각 그룹을 겹쳐서 표현 3개 이상에서는 어려움 - area plot 사용 투명도를 조절하는 alpha Grouped Bar plot 각 그룹을 이웃되게 표현 구현이 까다로움(set_xticks, set_xticklabels) 그룹이 많을 경우 예외 처리 Principle of Proportion ink 실제 값과 표현되는 잉크 양은 비례해야 함 x축의 시작은 zero Data sorting 시계열 - 시..
Matplotlib Matplotlib Figure(틀) - subplot(그래프) figsize - figure 크기 fig.get_facecolor() - 바깥 배경색 color, label, legend(범례) set_title - sub title, suptitle - super title ticks(범위), ticklabels(텍스트) annotate, text - 원하는 좌표에 텍스트 출력
Data visualization Data visualization Data - global data? local data? 정형 데이터(csv) : 통계적 특성, 데이터 간 비교 시계열 데이터 : 추세(trend), 계절성(seasonality), 주기성(cycle) 지리 데이터 : 거리, 경로, 분포 관계 데이터 : 객체 - 객체 관계, node - link, 휴리스틱한 노드 배치 계층적 데이터 : tree, treemap, sunburst 등 mark - basic praphical element in an image - 점, 선, 면으로 이루어진 데이터 시각화 channel - 각 마크를 변경할 수 있는 요소들 - 위치, 색, 모양 등 pre-attentive attribute - 주의를 주지 않아도 인지되는 요소 - 분리되어 있..
2주차 정리 torch.Tensor - class, alias(torch.FloatTensor) input - torch : input의 데이터 공간을 사용 input - list, numpy : 새로운 torch.Tensor를 만든 후 사용 torch.tensor - function input을 새로운 메모리를 할당하여 복사 후 사용 1차원 벡터는 행벡터, 열벡터의 형태로 둘 다 표현 가능 dim, axis torch.triu() einsum() Vector inner product: "a,a->" (Assumes two vectors of same length) Vector element-wise product: "a,a->a" (Assumes two vectors of same length) Vector out..
Trouble shooting Out Of Memory 정확한 에러 해결이 어려움 원초적인 방법 -> batch size down GPUtil GPU의 상태를 보여주는 모듈 iter마다 메모리가 늘어나는지 확인할 것 import GPUtil GPUtil.showUtilization torch.cuda.empty_cache() # 사용되지 않은 gpu cache 정리 # del과 구분해야 함 # reset대신 쓰기 좋음 1d tensor는 기본 객체로 변환하여 저장 필요 없는 변수는 del 삭제 OOM 발생 시 batch size 1로 해보기 with torch.no_grad(): # statement # backward가 일어나지 않음 colab에서 너무 큰 사이즈는 x CNN은 대부분 shape 문제 tensor의 float pre..