splitting bipartite graphs (again)

User 1129 | 1/29/2015, 9:54:04 AM

In the past, I have asked about the possibility to split bipartite graphs (http://forum.dato.com/discussion/comment/2277). For example: if a graph connects users who liked certain items, we can split this graph into two: users who liked same items and items who were liked by the same users. For example, igraph, has this function http://igraph.org/python/doc/igraph.Graph-class.html#bipartite_projection that performs just that.

In the previous question, Danny suggested me to use item recommendation, which seems to work fine. However, I have noticed that there is a hard limit on the number of outgoing edges for every node (which is 10). I couldn't find any parameter that will control this.

Is there a way to overcome this limit?

Comments

User 92 | 2/3/2015, 1:53:00 AM

Hi bgbg,

To answer your original question, we do not have a readily available API to help you partition a graph to two, but it is very each to split a graph according to some criteria using our SFrame operations. As an example, if you have a graph that has user, item and likes, you can get the edges as an SFrame using (g.get_edges) and then the rest is all SFrame operations.

Here is an example regarding how to group all users by the items they like:

<pre>likes = gl.SFrame({'user':['1','2','3','4','5'], 'item':['a','b','c','d','a'], 'likes':[1,0,1,0,1]})

group all users that like the same item:

likes.groupby('item', gl.aggregate.CONCAT('user')) </pre>

Hope this helps!

Ping