Getting the Right Web page
219
The new function
PageRank_naive
wraps all the previously described operations
and emits a vector of probabilities (the PageRank score) for each node in the
network. The third node emerges as the one with most importance. Unfortunately,
the same function doesn’t work with the other two networks:
print(PageRank_naive(Graph_B))
Warning: G is substochastic
[ 0. 0. 0. 0. 0. 0.]
print(PageRank_naive(Graph_C))
[ 0. 0. 0. 0.222 0.444 0.333]
In the first case, the probabilities seem to drain out of the network — the effect of
a dead-end website and the resulting substochastic transition matrix. In the
second case, the bottom half of the network unfairly gets all the importance, leav-
ing the top part as insignificant.
Do'stlaringiz bilan baham: |