当前位置:网站首页>【信息检索】链接分析
【信息检索】链接分析
2022-07-04 12:51:00 【Alex_SCY】
(1). 阅读教材《Introduction to Information Retrieval》第464-470页21.2节中所描述的PageRank计算方法(通过power iteration方式来实现),用Java语言或其他常用语言实现该算法。要求以下图所示的结构为例计算每个document的PageRank值,其中teleportation rate=0.05。

预先设定一些程序参数:
根据题目中给定的图创建邻接矩阵:

对于此题,邻接矩阵如下所示:
linkMatrix[i][j]=1说明有一条从节点i指向节点j的有向边。
然后开始计算转移概率矩阵:
一共三步:
- 用每行中的1的个数取出每个1
- 处理后的结果矩阵乘以1-α
- 对上面得到的矩阵中的每个元素都加上alpha/N

最终可以得到本体对应的转移概率矩阵:
进行幂迭代法:
初始化概率分布向量:
然后根据如下公式进行迭代,直到概率分布向量收敛:

最终计算结果如下所示:迭代一次后即可收敛
即Pagerank(d1)=0.017,Pagerank(d2)=0.492,Pagerank(d3)=0.492。简单分析可知,d2与d3是对称的。同时由于没有document指向d1,只有当遇到随机跳转时会跳转到document1,所以Pagerank(d1)会明显小于另外两个值。
(2). 以另一种方式(不是power iteration方式)用笔算(不用程序计算)题(1)中每个document的PageRank值。要求有详细的说明和计算过程。(10分)
可以根据代数算法进行计算:
PageRank的定义式:
于是:
其中M为转移概率矩阵(无随机跳转),1为[1*N]的全一矩阵,I为单位矩阵
由此可以得到
,Pagerank(d1)=0.017,Pagerank(d2)=0.492,Pagerank(d3)=0.492,结果同幂迭代法得到结果。
(3). 阅读教材《Introduction to Information Retrieval》第474-477页21.3节中所描述的HITS计算方法(通过power iteration方式来实现),用Java语言或其他常用语言实现该算法。要求以下图所示的结构为例计算每个document的authority值和hub值。

预先设定一些程序参数:
然后对图中的节点进行标号,并生成对应的邻接矩阵,如下所示:

邻接矩阵:
初始化hub以及authority向量:
根据如下公式开始迭代,同时每一次迭代过后需要对于向量进行归一化处理,直到hub与authority向量收敛:

最终运行结果如下所示:

最终hub值最大的是节点8(处于base set) ,节点8指向了节点7和9,同时7和9又被多个节点指向(authority值高),因此节点8的hub值最高十分合理。
authority值最大的是节点7 (处于root set),节点7被节点2,3,8指向,同时节点2,3,8的hub值高,因此节点7的authority值最高十分合理。
hub/authority值可以反应一个网页的导航度与权威度。不同的网站目的应该侧重于不同的指标,例如导航网站应该侧重hub值,这样可以指向更精准;而门户网站则应该侧重authority值,让更多导航网站指向它,提高权威度。
边栏推荐
- Deming Lee listed on Shenzhen Stock Exchange: the market value is 3.1 billion, which is the husband and wife of Li Hu and Tian Hua
- Understand chisel language thoroughly 08. Chisel Foundation (V) -- wire, REG and IO, and how to understand chisel generation hardware
- Haobo medical sprint technology innovation board: annual revenue of 260million Yonggang and Shen Zhiqun are the actual controllers
- Unity shader learning (3) try to draw a circle
- Excel快速合并多行数据
- Gorm read / write separation (rotation)
- 華昊中天沖刺科創板:年虧2.8億擬募資15億 貝達藥業是股東
- Common content type correspondence table
- 递增的三元子序列[贪心训练]
- LifeCycle
猜你喜欢

Unittest框架中引入TestFixture
![[R language data science]: cross validation and looking back](/img/a8/84a5685ebcb12d3cf8e32e1fbac053.png)
[R language data science]: cross validation and looking back

DDD application and practice of domestic hotel transactions -- Code

Understand chisel language thoroughly 05. Chisel Foundation (II) -- combinational circuits and operators

2022 practice questions and mock exams for the main principals of hazardous chemical business units

安装Mysql

Applet live + e-commerce, if you want to be a new retail e-commerce, use it!

德明利深交所上市:市值31亿 为李虎与田华夫妻档

瑞吉外卖笔记

Unity shader learning (3) try to draw a circle
随机推荐
Basic mode of service mesh
Install MySQL
Understand chisel language thoroughly 08. Chisel Foundation (V) -- wire, REG and IO, and how to understand chisel generation hardware
Migration from go vendor project to mod project
富文本编辑:wangEditor使用教程
The font of markdown grammar is marked in red
Programmer anxiety
CVPR 2022 | greatly reduce the manual annotation required for zero sample learning, and propose category semantic embedding rich in visual information (source code download)
IDEA快捷键大全
吃透Chisel语言.12.Chisel项目构建、运行和测试(四)——Chisel测试之ChiselTest
Code hoof collection of wonderful secret place
92.(cesium篇)cesium楼栋分层
Install and use MAC redis, connect to remote server redis
华昊中天冲刺科创板:年亏2.8亿拟募资15亿 贝达药业是股东
Mask wearing detection based on yolov1
JVM memory layout detailed, illustrated, well written!
R语言ggplot2可视化:gganimate包创建动态折线图动画(gif)、使用transition_reveal函数在动画中沿给定维度逐步显示数据
Idea shortcut keys
[R language data science]: cross validation and looking back
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.col参数指定强调线的id子集的颜色(色彩)