본문 바로가기

Principal component analysis (PCA) on data 0. PCA란? PCA는 principal component analysis의 약자로 주어진 데이터의 principal component를 찾는 알고리즘이다. 그리고 principal component는 주어진 데이터를 가장 잘 표현하는 축인 basis를 의미한다. 즉 PCA를 이해하기 위해서는 주어진 데이터를 잘 표현하는 것이 무엇인지를 알아야한다. PCA에서는 분산을 최대로하는 basis를 찾는 것을 의미한다. 밑의 구현에서 보면 알겠지만 데이터를 col 방향으로 쌓은 matrix D가 있을 때 분산은 D'*D이고, D'*D의 eigenvector들이 principal component들이다. 데이터의 손실률은 eigenvalue의 합에 반비례한다. 1. PCA 결과 [그림을 클릭하면 크게 보임] 2.. 더보기
TOEFL ? Speaking Writing Writing formula Do you agree or disagree with the following statement? Governments should focus its budgets more on environmental protection than on economic development. (agree) - It is evident that achieving an economic property is one of the major roles of the government in our modern society. It can be easily verified by just looking at campaign promises of the politicians. .. 더보기
Dirichlet Process (DP) Dirichlet Process (DP)는 매우 복잡스러운 수학의 결과가 우리의 직관과 맞을 수 있다는 것을 보여주는 좋은 예라 할 수 있겠다. DP는 그 이름에서 알 수 있듯이 Dirichlet distribution을 따르는 random process이다. Random process라 함은 시간에 따라 특정 분포를 따르는 Random variable들의 sequence라 생각할 수 있다. 나 개인적으로는 특정한 Probability allocation function을 갖는 Sample space에서 임의로 random variable들을 뽑는다는 개념을 좋아한다. 물론 RP에 시간에 따른 함수를 추가할 수 있기 때문에 정확한 정의는 아니다. 각설하고 DP는 unsupervised clustering.. 더보기
Get CLICK point in an Image 매트랩에서 이미지로 놀다보면 가끔 이미지에서 위치를 읽어오고 싶을 때가 있다. 그럴 때 유용하게 쓰일 수 있는 예제 코드이다. 1. mainclc;clear all;close all; global cursor_pos;global clicked_flag;cursur_pos = [];clicked_flag = 0; %% 이미지를 읽어와서 클릭 위치를 disp한다. img = imread('example.jpg');fig = imshow(img);drawnow;set(fig, 'ButtonDownFcn',@buttonDownCallback);fprintf('now click the image \n'); hold on;while 1 if clicked_flag cur_pos = cursor_pos(end, :).. 더보기