Trustlet.org, analyzing trust metrics using Python

Warning: this presentation will contain source code.

Python

 * high-level programming languages, first releaed in 1991
 * high readability
 * programmer effort over computer effort
 * multi-paradigm: functional, OO, imperative
 * similar to Perl, Ruby, Scheme and Tcl
 * open, community-based development managed by non-profit Python Software Foundation


 * fast prototyping of new algorithms
 * easy to teach
 * multi-platform

NetworkX (NX)
NX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.


 * standard graph-theoretic and statistical physics functions
 * easy exchange of network algorithms between applications, disciplines, and platforms
 * includes many classic graphs and synthetic networks
 * nodes and edges can be "anything" (e.g. time-series, text, images, XML records)
 * exploits existing code from high-quality legacy software in C, C++, Fortran, etc.
 * open source (encourages community input)

numpy

 * numerical analysis in Python
 * all advantages of Python (as opposed to Matlab)
 * free license

Datasets

 * automatically download if dataset not available locally

Advogato

 * Some other sites.

Trust metrics
A trust metric is a technique for predicting how much a certain user can be trusted by the other users.

The basic assumption of trust metrics is that trust can be propagated in some way. The reason is that you trust your friend more than a stranger and so, under certain conditions, a friend of your friend is possibly more trustworthy than a random stranger (at least because your friend trusts her).

For example, in the context of movies tastes, if all your 10 trusted cinema-friends trust "mary" (that you don't know) about her movies tastes, can we predict that you will find her opinions about movies useful as well?

A simple example. Suppose you have the following information: ME trusts Alice, Me trusts Bob, Alice trusts Carol, Bob trusts Carol (this is a simple trust network). You might want to ask yourself: should ME trust Carol? A trust metric is nothing but a tool for finding an answer to this question.

Trust metrics can either be local or global, depending on the fact they compute personalized values of trust or not.

Ebay trust metrics
def ebay_tm(G, a, b): """Average of incoming edges of b""" return avg_or_none(map(G.trust_on_edge, G.in_edges(b)))

..
|| _ _

Leave one out
def leave_one_out(self, e): """The leave-one-out algorithm, for some trust metrics it's       much better to subclass this.""" self.G.delete_edge(e) trust_value = self.trustmetric(self.G, e[0], e[1]) self.G.add_edge(e) return trust_value

Future

 * more datasets
 * something with Wikipedia database dump?
 * suggestions?