Clique Percolation Method in Python

Clique Percolation Method (CPM) is an algorithm for finding overlapping communities within networks, introduced by Palla et al. (2005, see references). This implementation in Python, firstly detects communities of size k, then creates a clique graph. Each community will be represented by each connected component in the clique graph. Algorithm The algorithm performs the following … Read more

Computing Automorphic Numbers

In our lab, we like to tease each other with fancy riddles. In our kitchen, we have a large wooden box, filled with some chocolates and locked by a 4-digits lock. Those who crave for some sugar will just need to solve the riddle and unlock the box.
The last few riddles involved a particular family of numbers which are called automorphic, and the complexity of such riddles was increasing with the size of those numbers in terms of the number of digits. For instance, in the last riddle, we were asked to compute a number with 44444 digits, requiring an enormous computational power.
In this post, I will show how I developed the algorithm that allowed me to solve the riddle.

Export Graph in R via JSON

This post presents an easy solution for exporting and importing a graph object of igraph library.
In its previous versions, the library used to have the save and load functions in which you could respectively export and import the graph object [1]. Although they seem to not be in the library anymore, the documentation states:

“Attribute values can be set to any R object, but note that storing the graph in some file formats might result the loss of complex attribute values. All attribute values are preserved if you use save and load to store/retrieve your graphs.

The library also proposes write_graph and read_graph, that rely on the GraphML format, for exporting and importing back graph objects.

However, here I propose my little solution with almost zero options. It saves the graph and allows to re-load it again (in another session as well) simply saving all the fields and values in a JSON file.

Read more

Clique Percolation Method in R: a fast implementation

Clique Percolation Method (CPM) is an algorithm for finding overlapping communities within networks, introduced by Palla et al. (2005, see references). This implementation in R, firstly detects communities of size k, then creates a clique graph. Each community will be represented by each connected component in the clique graph.

Algorithm

The algorithm performs the following steps:

1- first find all cliques of size k in the graph
2- then create graph where nodes are cliques of size k
3- add edges if two nodes (cliques) share k-1 common nodes
4- each connected component is a community

Read more

XMLResearcherProfile

 

XMLResearcherProfile is a technology for tracking and presenting academics’ profile. In its early stage, it allows to record all the published papers (in proceedings, journals, posters and phd thesis) within a single XML file and afterwards it allows to format them as a list in a HTML page. Using specific XML tags it is possible to describe all the meaningful information about each published papers, such as title, authors, year of publication, book title and web sources. Initially, all these tags were specified using a DTD file (rpDTD.dtd), while lately an XML schema (rpSchema.xml) replaced it. The new schema contains a set of rules to describe all the tags that the XML file can contain. An instance of published paper with its relative tags is presented below.

Read more

Pie Chart with QWT

Pie Chart with QWT is a little application able to show a pie chart using QWT library. This idea (allow me to use it) is born because in a project that I was developing I used QWT to make some plots and when I looked for a pie chart there only one chance to get it, using the little pie chart inside Cpu Plot example. This project re-implements the pie chart inside Cpu Plot in order to create a more dynamic and simple one.

In fact, to create a pie chart with this project only the names, the colors and the sector percentages are needed. It acts as a wrapper and any other customization is not needed.

Read more

Grid Search SVM

The Grid Search SVM is a Java-based application that allows to perform the grid search of an SVM classifier. According to the section 3.2 of (Hsu, Chang and Lin: A Practical Guide to Support Vector Classication) [1], the grid search consists in identifying the best (C, γ) values that allow to classify accurately the unknown data ( new instances as the test data).
In the same work they suggest a practical method to perform the grid search that consists in the exponentially growing of C and γ. They also gives the range the values for those parameters. For example C = [2-5, …, 215] and γ = [2-15, …, 23] (see also here).
The software here presented uses the LIBSVM to implement an SVM classifier and Weka classes as interface to classifiers and dataset. This software as it is said before, will take a particular classifier and will try to train and test on different values of C and γ. All the performances obtained will be stored inside a text file given as output file.

Read more