当前位置:网站首页>【信息检索】链接分析
【信息检索】链接分析
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值,让更多导航网站指向它,提高权威度。
边栏推荐
- Understand chisel language thoroughly 03. Write to the developer of Verilog to chisel (you can also see it without Verilog Foundation)
- 【C 题集】of Ⅶ
- Programmer anxiety
- 吃透Chisel语言.10.Chisel项目构建、运行和测试(二)——Chisel中生成Verilog代码&Chisel开发流程
- IP 实验室月复盘 · 第 5 期
- 吃透Chisel语言.03.写给Verilog转Chisel的开发者(没有Verilog基础也可以看看)
- Understand chisel language thoroughly 04. Chisel Foundation (I) - signal type and constant
- 瑞吉外卖笔记
- DDD application and practice of domestic hotel transactions -- Code
- Introducing testfixture into unittest framework
猜你喜欢

DDD application and practice of domestic hotel transactions -- Code

吃透Chisel语言.11.Chisel项目构建、运行和测试(三)——Chisel测试之ScalaTest

数据仓库面试问题准备

MySQL5免安装修改

Xcode 异常图片导致ipa包增大问题

Mask wearing detection based on yolov1

Rich text editing: wangeditor tutorial

吃透Chisel语言.09.Chisel项目构建、运行和测试(一)——用sbt构建Chisel项目并运行
![递增的三元子序列[贪心训练]](/img/92/7efd1883c21c0e804ffccfb2231602.png)
递增的三元子序列[贪心训练]

【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
随机推荐
WS2818M是CPC8封装,是三通道LED驱动控制专用电路外置IC全彩双信号5V32灯可编程led灯带户外工程
Qt如何实现打包,实现EXE分享
92.(cesium篇)cesium楼栋分层
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
Fs4059c is a 5V input boost charging 12.6v1.2a. Inputting a small current to three lithium battery charging chips will not pull it dead. The temperature is 60 ° and 1000-1100ma is recommended
Understand chisel language thoroughly 04. Chisel Foundation (I) - signal type and constant
10.(地图数据篇)离线地形数据处理(供Cesium使用)
Golang 使用 JSON unmarshal 数字到 interface{} 数字变成 float64 类型(转)
Huahao Zhongtian sprint Technology Innovation Board: perte annuelle de 280 millions de RMB, projet de collecte de fonds de 1,5 milliard de Beida Pharmaceutical est actionnaire
Why should Base64 encoding be used for image transmission
华昊中天冲刺科创板:年亏2.8亿拟募资15亿 贝达药业是股东
gin集成支付宝支付
程序员的焦虑
Read excel table data
Incremental ternary subsequence [greedy training]
golang fmt.printf()(转)
Ws2811 m is a special circuit for three channel LED drive and control, and the development of color light strip scheme
QT how to detect whether the mouse is on a control
R语言使用lattice包中的bwplot函数可视化箱图(box plot)、par.settings参数自定义主题模式
MongoDB常用28条查询语句(转)