From ebef6145581cb0439eba28c836b71a8680b9493c Mon Sep 17 00:00:00 2001
From: Fize Jacques <jacques.fize@cirad.fr>
Date: Mon, 17 Sep 2018 09:54:41 +0200
Subject: [PATCH] Change Readme+ update BagOfNodes call (bow.pyx --> bon.pyx
 and BOW became BagOfNodes)

---
 README.md                      | 26 +++++++++-----------------
 gmatch4py/__init__.py          |  3 ++-
 gmatch4py/{bow.pyx => bon.pyx} |  6 ++++--
 3 files changed, 15 insertions(+), 20 deletions(-)
 rename gmatch4py/{bow.pyx => bon.pyx} (91%)

diff --git a/README.md b/README.md
index afa2f3f..260f0dd 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 5208106..0d1e527 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 39549ee..396231e 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)
 
-- 
GitLab