Hello, people
I only registered here for this matter (although it is a great forum).
I am a ph.d. student and need to investigate eigenvector centrality measure for my homework.
I found Phyton code on net and would like to see does it produce the same results as mine, written in Matlab.
But I don't use Phyton, would someone be so nice and translate it, it is so painfully simple and wright now I don't have time to start learning it from scratch.
Thank you, really
Here is the code:
from numpy import *
def norm2(v):
return sqrt(v.T*v).item()
def PowerMethod(A, y, e):
while True:
v = y/norm2(y)
y = A*v
t = dot(v.T,y).item()
if norm2(y – t*v) <= e*abs(t):
return (t, v)