Commit ebef6145 authored by Fize Jacques's avatar Fize Jacques
Browse files

Change Readme+ update BagOfNodes call (bow.pyx --> bon.pyx and BOW became BagOfNodes)

No related merge requests found
Showing with 15 additions and 20 deletions
+15 -20
...@@ -9,6 +9,7 @@ GMatch4py algorithms were implemented with Cython to enhance performance. ...@@ -9,6 +9,7 @@ GMatch4py algorithms were implemented with Cython to enhance performance.
* Cython * Cython
* networkx * networkx
* numpy * numpy
* scikit-learn
## Installation ## Installation
...@@ -17,19 +18,14 @@ To install `GMatch4py`, run the following commands: ...@@ -17,19 +18,14 @@ To install `GMatch4py`, run the following commands:
``` ```
$ git clone https://github.com/Jacobe2169/GMatch4py.git $ git clone https://github.com/Jacobe2169/GMatch4py.git
$ cd GMatch4py $ cd GMatch4py
$ python3 setup.py install $ (sudo) python3 setup.py install
``` ```
or
```
$ (sudo) pip3 install .
```
## Get Started ## Get Started
### Graph input format ### 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) 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 ### Use Gmatch4py
...@@ -61,8 +57,8 @@ print(result) ...@@ -61,8 +57,8 @@ print(result)
The output is a similarity/distance matrix : The output is a similarity/distance matrix :
``` ```
Out[10]: Out[10]:
array([[0., 7.], array([[0., 14.],
[7., 0.]]) [10., 0.]])
``` ```
This output result is "raw", if you wish to have normalized results in terms of distance (or similarity) you can use : 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) ...@@ -77,8 +73,9 @@ ged.distance(result)
## List of algorithms ## List of algorithms
* DeltaCon and DeltaCon0 (*debug needed*) [1] * DeltaCon and DeltaCon0 (*debug needed*) [1]
* Vertex Ranking (*debug needed*) [2] * Vertex Ranking [2]
* Vertex Edge Overlap [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) * Bag of Cliques (a bag of words model using cliques as vocabulary)
* Graph kernels * Graph kernels
* Random Walk Kernel (*debug needed*) [3] * Random Walk Kernel (*debug needed*) [3]
...@@ -109,15 +106,10 @@ ged.distance(result) ...@@ -109,15 +106,10 @@ ged.distance(result)
Jacques Fize, *jacques[dot]fize[at]cirad[dot]fr* 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.** each code is associated with a reference to the original.**
## TODO List ## TODO List
* Debug algorithms --> :runner: * Debug algorithms --> :runner: (almost done !)
* 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:
* Write the documentation :runner: * Write the documentation :runner:
\ No newline at end of file
...@@ -17,4 +17,5 @@ from .bag_of_cliques import * ...@@ -17,4 +17,5 @@ from .bag_of_cliques import *
from .mcs import * from .mcs import *
from .vertex_edge_overlap import * from .vertex_edge_overlap import *
from .vertex_ranking import * from .vertex_ranking import *
from .jaccard import * from .jaccard import *
\ No newline at end of file from .bon import *
...@@ -6,8 +6,10 @@ cimport numpy as np ...@@ -6,8 +6,10 @@ cimport numpy as np
from sklearn.metrics.pairwise import cosine_similarity from sklearn.metrics.pairwise import cosine_similarity
from .base cimport Base from .base cimport Base
cdef class BOW(Base): cdef class BagOfNodes(Base):
"""
We could call this algorithm Bag of nodes
"""
def __init__(self): def __init__(self):
Base.__init__(self,0,True) Base.__init__(self,0,True)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment