About this entry
You’re currently reading “Reference implementation of SPEAR algorithm released”.
- Author:
- Michael G. Noll
- Published:
- Jul 10, 2010
- Last updated:
- Jul 12, 2010
- Bookmark:
- Permanent Link
- Tags:
- algorithm, expertise, experts, foss, gpl, hits, implementation, information retrieval, library, license:gplv2, module, open source, python, ranking, Research, sigir, spam, spammers, spear (show tag cloud)
Reference implementation of SPEAR algorithm released
I have just released the “reference” implementation of our SPEAR algorithm. The library is written in the Python programming language, and should be straight-forward to use. You can install the library via Python’s setuptools/easy_install or download it from GitHub.
Here’s a quick example on how to use it:
-
>>> import spear
-
>>> activities = [
-
… (datetime.datetime(2010,7,1,9,0,0), "alice", "http://www.quuxlabs.com/"),
-
… (datetime.datetime(2010,8,1,12,45,0), "bob", "http://www.quuxlabs.com/"),
-
… ]
-
>>> spear_algorithm = spear.Spear(activities)
-
>>> expertise_results, quality_results = spear_algorithm.run()
Get the top user and his expertise score:
-
>>> expertise_score, user = expertise_results[0]
-
>>> print "%s => %.4f" % (user, expertise_score)
-
alice => 0.5858
Get the top resource and its quality score:
-
>>> quality_score, resource = quality_results[0]
-
>>> print "%s => %.4f" % (resource, quality_score)
-
http://www.quuxlabs.com/ => 1.0000
You can also use the library to simulate the HITS algorithm of Jon Kleinberg. Simply supply a credit score function C(x) = 1 to the SPEAR algorithm (see the documentation of the Spear.run() method).
Feel free to play around with it and send me feedback!
PS: The SPEAR Python library requires SciPy/NumPy. If you don’t have these installed already, here are some installation instructures to get you started.
No comments
Jump to comment form | comments rss | trackback uri