Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/igrigorik/rb-pagerank
Code from RailsConf '09 pres: Building Mini Google in Ruby
https://github.com/igrigorik/rb-pagerank
Last synced: about 2 months ago
JSON representation
Code from RailsConf '09 pres: Building Mini Google in Ruby
- Host: GitHub
- URL: https://github.com/igrigorik/rb-pagerank
- Owner: igrigorik
- Created: 2009-05-02T18:21:19.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-02-20T16:28:57.000Z (almost 15 years ago)
- Last Synced: 2024-05-08T18:35:28.650Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 75.2 KB
- Stars: 54
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
= Computing PageRank in Ruby
Notes & code from RailsConf 2009 presentation: http://en.oreilly.com/rails2009/public/schedule/detail/7966Slides: http://bit.ly/railsconf-pagerank
== Example:
# page 1 -> page 2 (0.33)
# page 2 -> page 3 (0.33)
# page 3 -> page 1 (0.33)
puts "Circular: ", pagerank(Matrix[[0,0,1], [0,0,1], [1,0,0]])# page 1 -> page 3 (0.05) # page 1 & page 2 have minimal postrank values
# page 2 -> page 3 (0.05) # min value = min(t * Teleport Vector)
# page 3 -> page 3 (0.09) # for uniform teleport vector, min = t * (1/N)
puts "Star: ", pagerank(Matrix[[0,0,0], [0,0,0], [1,1,1]])# page 1 -> page 2, page 3 (0.05)
# page 2 -> page 3 (0.07)
# page 3 -> page 3, page 3 (0.87)
puts "Converge: ", pagerank(Matrix[[0,0,0], [0.5,0,0], [0.5,1,1]])# page 1 -> page 1, page 2 (0.18)
# page 2 -> page 1, page 3 (0.13)
# page 3 -> page 3 (0.69)
puts "Linked:", pagerank(Matrix[[0.5,0.5,0], [0.5,0,0], [0,0.5,1.0]])