diff --git a/README.md b/README.md index afa2f3f5f253b525ba7ba083bac92969a6a2d943..260f0dd36d8f385c5de5695c32c246fa72bc17ab 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ GMatch4py algorithms were implemented with Cython to enhance performance. * Cython * networkx * numpy + * scikit-learn ## Installation @@ -17,19 +18,14 @@ To install `GMatch4py`, run the following commands: ``` $ git clone https://github.com/Jacobe2169/GMatch4py.git $ cd GMatch4py -$ python3 setup.py install +$ (sudo) python3 setup.py install ``` -or - -``` -$ (sudo) pip3 install . -``` ## Get Started ### Graph input format -In `Gmatch4py`, algorithms manipulate `networkx.Graph`, a complete graph model that +In `GMatch4py`, algorithms manipulate `networkx.Graph`, a complete graph model that comes with a large spectrum of parser to load your graph from various inputs : `*.graphml,*.gexf,..` (check [here](https://networkx.github.io/documentation/stable/reference/readwrite/index.html) to see all the format accepted) ### Use Gmatch4py @@ -61,8 +57,8 @@ print(result) The output is a similarity/distance matrix : ``` Out[10]: -array([[0., 7.], - [7., 0.]]) +array([[0., 14.], + [10., 0.]]) ``` This output result is "raw", if you wish to have normalized results in terms of distance (or similarity) you can use : @@ -77,8 +73,9 @@ ged.distance(result) ## List of algorithms * DeltaCon and DeltaCon0 (*debug needed*) [1] - * Vertex Ranking (*debug needed*) [2] + * Vertex Ranking [2] * Vertex Edge Overlap [2] + * Bag of Nodes (a bag of words model using nodes as vocabulary) * Bag of Cliques (a bag of words model using cliques as vocabulary) * Graph kernels * Random Walk Kernel (*debug needed*) [3] @@ -109,15 +106,10 @@ ged.distance(result) Jacques Fize, *jacques[dot]fize[at]cirad[dot]fr* -Some algorithms coming from other projects were integrated to Gmatch4py. **Be assured that +Some algorithms from other projects were integrated to Gmatch4py. **Be assured that each code is associated with a reference to the original.** ## TODO List - * Debug algorithms --> :runner: - * Improve code structure and performance :runner: - * Simplify `setup.py` :heavy_check_mark: - * Some algorithms are distance and others are similarity measure. Must change the compare - methods so it can adapt to the user need. For example, maybe the user want to deal with - graph similarity rather than distance between graph. :heavy_check_mark: + * Debug algorithms --> :runner: (almost done !) * Write the documentation :runner: \ No newline at end of file diff --git a/gmatch4py/__init__.py b/gmatch4py/__init__.py index 5208106782b0bbd7564f6745528a138946fb1fff..0d1e527e3f64061d8fedff30ca5a79402f412f53 100644 --- a/gmatch4py/__init__.py +++ b/gmatch4py/__init__.py @@ -17,4 +17,5 @@ from .bag_of_cliques import * from .mcs import * from .vertex_edge_overlap import * from .vertex_ranking import * -from .jaccard import * \ No newline at end of file +from .jaccard import * +from .bon import * diff --git a/gmatch4py/bow.pyx b/gmatch4py/bon.pyx similarity index 91% rename from gmatch4py/bow.pyx rename to gmatch4py/bon.pyx index 39549ee7d3b9705a2c7fa3c54b7fa299b0537116..396231e7f98677ce6c3ce5db2281979fa8e768c5 100644 --- a/gmatch4py/bow.pyx +++ b/gmatch4py/bon.pyx @@ -6,8 +6,10 @@ cimport numpy as np from sklearn.metrics.pairwise import cosine_similarity from .base cimport Base -cdef class BOW(Base): - +cdef class BagOfNodes(Base): + """ + We could call this algorithm Bag of nodes + """ def __init__(self): Base.__init__(self,0,True)