expertis | Blog
expertis | Blog
  • expertis.co
  • Posts
MENU CLOSE back  

Social Network Analysis

For the following analysis I work with the “ingredients” network. This is a larger network, set of 1,106 ingredients mined from recipes on allrecipes.com. It is a one-mode projection of the ingredient-recipe bi-partite network. In other words, there is a link between two ingredients if they appear in the same recipe. The edges have a weight that reflects how often such pairings occur. There are more than 39,000 edges; reflecting a density around 3%.

In the analysis you would see how to work with R to create and export data to make visualizations with Gephi. I have included filtering, community detection, subgraph creation using degree as weight. In terms of the number of groups only two algorithms show similar numbers of clusters, betweenness and fastgreedy. Betweenness is focuse on finding conections between different communities. In contrast the fastgreedy algorithm that identify once modularity is not increasing. Nodes with high betweenness showld not contribut positevely to the fastgreedy algorithm and are the key to identify communities in the firts algorithm. This algorithms seem to be counterparts, providing similar results in terms of modularity and number of groups. In addition this algorithm have the highest modularity. Modularity among the algorithms similar, apparently the communities found have significan connection among the vertices.

The first visualizaiton belong to the community identify with the Fastgreedy algorithm. This community has two local networks or types of food. One that belongs to the ingredient I choose, which is cheese ravioli. This local network is related to Italian cousine. The second local network is food or ingredients derived from milk. There are two nodes within the Italian food that have strong edges to skim milk and egg substitute. This is the reason why this local networks are together in this community detected by Fastgreedy.

The second visualization is all about Italian food. There are no evident local networks whithin it. There are tow main things that came as a surprise to see. Firts the ingredient had only one edge to spauetti sauce. I would have expected to see a edges to types of cheese, spinach which are common in ravioli. The second thing is that even when I selected a node with low degree the communi detection delivers all vertex related and so I was able to see its network. The following visualizations are focus on the choosen ingredient in both communities.

For this analysis the Fastgreedy algorithm objective is to maximize modularity. Since there are nodes with strong ties between Italian cousine and egg sustitues and skim milk the algorithm was able to keep improving modularity without recognizing that it had gone to another local network. On the other hand, walktrap tends to stay within same comunities. The result is that the Italian cousine is identify as a single community while the other is a ingridient related netwok.

 

Here you may see the documented R code for the Social Net analysis

May 3, 2016By jsotelo
PCA, SVD & AR in PythonMachine Learning in Python

Related posts

images
NFL Predictions
January 16, 2017
images-1
NBA predictions
December 19, 2016
peppers-in-summer
Multi-Label Learning by Exploiting Label Dependency
July 8, 2016
u2u-color-by-Modularity
Amazon product co-purchasing network
June 10, 2016
kmeans
PCA, SVD & AR in Python
May 30, 2016
MLP
Machine Learning in Python
May 2, 2016

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

clear formSubmit

Categories
  • Association Rule (2)
  • Classification (8)
  • Decision Trees (2)
  • Finance (2)
  • Gephi (1)
  • LDA (2)
  • Machine Learning (6)
  • Monte Carlo (4)
  • PCA (5)
  • Python (9)
  • R (6)
  • Random Forest (2)
  • Social Network (1)
  • SVD (2)
  • Thoughts (1)
  • TSA (3)
Julio Sotelo

julio.sotelo@expertis.co