ysig / GraKeL

A scikit-learn compatible library for graph kernels
https://ysig.github.io/GraKeL/
Other
594 stars 97 forks source link

One to one graph comparison example broken #3

Closed xia0pin9 closed 6 years ago

xia0pin9 commented 6 years ago

When following the documentation to conduct one to one graph comparison using the following code:

wl_kernel.fit(H2O).transform(H3O)

It raises an AttributeError exception:

AttributeError                       Traceback (most recent call last)
<ipython-input-267-4071ae7832b8> in <module>()
----> 1 wl_kernel.fit(H2O)

/usr/local/lib/python2.7/site-packages/grakel/graph_kernels.pyc in fit(self, X, y)
    315             self.component_indices_ = inds
    316         else:
--> 317             self.kernel.fit(X)
    318
    319         # Return the transformer

AttributeError: 'dict' object has no attribute 'fit'
ysig commented 6 years ago

Hi, you are probably using version 0.1a3 of grakel which is the only currently uploaded to pip.

To display execute pip show grakel-dev

Please install and use the latest version of grakel, namely the one from the repository (I think this error has been fixed around 1 month now). This is one of many bugfixes that will be uploaded as a version 0.1a4 of grakel to PyPi as soon as we finish a huge experimentation, we are currently conducting on the whole library (from which small errors may be raised to the surface).

Thanks for your understanding.

xia0pin9 commented 6 years ago

Seems 0.1a4 still has this problem.

In [28]: grakel.__version__
Out[28]: '0.1a4'

In [29]: sp_kernel.fit(g0)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-29-43dee3967136> in <module>()
----> 1 sp_kernel.fit(g0)

/usr/local/lib/python2.7/dist-packages/grakel/graph_kernels.pyc in fit(self, X, y)
    315             self.component_indices_ = inds
    316         else:
--> 317             self.kernel.fit(X)
    318
    319         # Return the transformer

AttributeError: 'dict' object has no attribute 'fit'
ysig commented 6 years ago

This error has been resolved about a month ago you can see that line 317 has been corrected and when it was resolved by git blame

Please install the latest grakel from the repository.