[데이터마이닝] 5.링크분석(Link analysis) 5.3절 연습문제(Exercise 5.3.5 )
Exercise 5.3.1 : Compute the topic-sensitive PageRank for the graph of Fig. 5.15, assuming the teleport set is: (a) A only. M = matrix(c(0, 1/3 ,1/3 ,1/3, 1/2,0,0,1/2, 1,0,0,0, 0, 1/2 , 1/2, 0),nrow = 4) r = matrix(c(1/4,1/4,1/4,1/4)) beta = 0.8 es = matrix(c(1,0,0,0),nrow=4) s = 1 pre_r = r r = (beta*M)%*%r + (1-beta)/s * es while(pre_r != r ){ pre_r = r r = (beta*M)%*%r + (1-beta)/s * es } r (..