From 9248a48a92e16aac8ca346e180481db4640cfd9f Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:20:41 +0530 Subject: [PATCH 01/10] Update __init__.py --- pykernels/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pykernels/__init__.py b/pykernels/__init__.py index 53f0736..de26884 100644 --- a/pykernels/__init__.py +++ b/pykernels/__init__.py @@ -1,6 +1,6 @@ -from basic import Linear, Polynomial, RBF -from regular import Exponential, Laplacian, RationalQuadratic, InverseMultiquadratic, Cauchy, TStudent,\ +from .basic import Linear, Polynomial, RBF +from .regular import Exponential, Laplacian, RationalQuadratic, InverseMultiquadratic, Cauchy, TStudent,\ ANOVA, Spline, Min, Log, Power, Chi2, AdditiveChi2, GeneralizedHistogramIntersection,\ Tanimoto, Sorensen, MinMax, Wavelet, Fourier -from graph.randomwalk import RandomWalk -from graph.allgraphlets import All34Graphlets +from .graph.randomwalk import RandomWalk +from .graph.allgraphlets import All34Graphlets From ce31e7d496864cebb885cf7233b261a3ac7ba7cd Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:21:19 +0530 Subject: [PATCH 02/10] Update basic.py --- pykernels/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pykernels/basic.py b/pykernels/basic.py index 0c72a67..3aa4261 100644 --- a/pykernels/basic.py +++ b/pykernels/basic.py @@ -5,9 +5,9 @@ __author__ = 'lejlot' -from pykernels.base import Kernel +from .base import Kernel import numpy as np -from utils import euclidean_dist_matrix +from .utils import euclidean_dist_matrix class Linear(Kernel): """ From cacea535bf845182277404e2a3850597ff8254d7 Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:21:44 +0530 Subject: [PATCH 03/10] Update regular.py --- pykernels/regular.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pykernels/regular.py b/pykernels/regular.py index c65f01e..8a9b03f 100644 --- a/pykernels/regular.py +++ b/pykernels/regular.py @@ -5,9 +5,9 @@ __author__ = 'lejlot' -from pykernels.base import Kernel +from .base import Kernel import numpy as np -from utils import euclidean_dist_matrix +from .utils import euclidean_dist_matrix import warnings class Cossim(Kernel): From ffb23875c3fc8ca2002dd54c5f3d6d9e639e5c7b Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:22:26 +0530 Subject: [PATCH 04/10] Update __init__.py --- pykernels/graph/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pykernels/graph/__init__.py b/pykernels/graph/__init__.py index 0d777da..44ee814 100644 --- a/pykernels/graph/__init__.py +++ b/pykernels/graph/__init__.py @@ -1,3 +1,3 @@ -from randomwalk import RandomWalk -from allgraphlets import All34Graphlets -from shortestpath import ShortestPath \ No newline at end of file +from .randomwalk import RandomWalk +from .allgraphlets import All34Graphlets +from .shortestpath import ShortestPath From ff7865d659e3e6b1d721f810975dd99f562b6d74 Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:22:56 +0530 Subject: [PATCH 05/10] Update allgraphlets.py --- pykernels/graph/allgraphlets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pykernels/graph/allgraphlets.py b/pykernels/graph/allgraphlets.py index 4681328..6a88006 100644 --- a/pykernels/graph/allgraphlets.py +++ b/pykernels/graph/allgraphlets.py @@ -7,7 +7,7 @@ import itertools import numpy as np from pykernels.base import Kernel, GraphKernel -import basic +from . import basic def dec2bin(k, bitlength=0): """Decimal to binary""" From a493e2b6de9dfc0e72d43796c0dd2c82e3e09149 Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:23:30 +0530 Subject: [PATCH 06/10] Update randomwalk.py --- pykernels/graph/randomwalk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pykernels/graph/randomwalk.py b/pykernels/graph/randomwalk.py index 7a69088..243a409 100644 --- a/pykernels/graph/randomwalk.py +++ b/pykernels/graph/randomwalk.py @@ -8,7 +8,7 @@ from pykernels.base import Kernel, GraphKernel from scipy.sparse import lil_matrix, kron,identity from scipy.sparse.linalg import lsqr -import basic +from . import basic def _norm(adj_mat): """Normalize adjacency matrix""" From 73487beed64f47eaa83ad5d99d769b3e8554c6bd Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:24:10 +0530 Subject: [PATCH 07/10] Update shortestpath.py --- pykernels/graph/shortestpath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pykernels/graph/shortestpath.py b/pykernels/graph/shortestpath.py index d62f627..a4f5d54 100644 --- a/pykernels/graph/shortestpath.py +++ b/pykernels/graph/shortestpath.py @@ -5,7 +5,7 @@ import numpy as np import numpy.matlib as matlib -import basic +from . import basic from pykernels.base import Kernel, GraphKernel from scipy.sparse import lil_matrix From 435b01c8f74f05c1daee3ae5bdad92f3cb9f55a3 Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:28:01 +0530 Subject: [PATCH 08/10] Update example.py --- example.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example.py b/example.py index 6e97350..4ac709b 100644 --- a/example.py +++ b/example.py @@ -7,12 +7,12 @@ X = np.array([[1,1], [0,0], [1,0], [0,1]]) y = np.array([1, 1, 0, 0]) -print 'Testing XOR' +print ('Testing XOR') for clf, name in [(SVC(kernel=RBF(), C=1000), 'pykernel'), (SVC(kernel='rbf', C=1000), 'sklearn')]: clf.fit(X, y) - print name - print clf - print 'Predictions:', clf.predict(X) - print 'Accuracy:', accuracy_score(clf.predict(X), y) - print + print (name) + print (clf) + print ('Predictions:', clf.predict(X)) + print( 'Accuracy:', accuracy_score(clf.predict(X), y)) + print() From af3d8ead4741ee95adf12cabd1164f98ca282f0b Mon Sep 17 00:00:00 2001 From: prashant rana Date: Fri, 31 May 2019 19:28:32 +0530 Subject: [PATCH 09/10] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ced23c5..f913b18 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ 'Intended Audience :: Machine Learning Research', 'License :: OSI Approved ::' + LICENSE, 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Scientific/Engineering :: Machine Learning', From 09b39a0bc80b2755f13400d66e8a7d1e579d98a1 Mon Sep 17 00:00:00 2001 From: prashant rana Date: Sat, 1 Jun 2019 03:21:12 +0530 Subject: [PATCH 10/10] Update basic.py --- pykernels/graph/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pykernels/graph/basic.py b/pykernels/graph/basic.py index effd26c..82f07a1 100644 --- a/pykernels/graph/basic.py +++ b/pykernels/graph/basic.py @@ -21,10 +21,10 @@ def graphs_to_adjacency_lists(data): try: if data.ndim == 3: return np.array(data) - except Exception, exc: + except Exception: try: return np.array([G.adjacency_matix for G in data]) - except Exception, exc: + except Exception: return np.array(data) def relabel(data, data_2):