Comments (2)
You should try a smaller lambda.
Theoretically geometric random walk converges if 1/lamda is bigger than the maximum eigenvalue of the kronecker product of the adjacency matrices of g1, g2. Only if the kernel converges it is psd. In another case the kernel value is not of a valid kernel and some other implementation set its value to zero.
A rule of thumb as noted by Viswanathan is setting lamda to the largest power of 10 which is smaller than 1/d^2, where d being the largest degree in the dataset.
B = [[0, 1, 1, 1, 1],
[1, 0, 1, 1, 1],
[1, 1, 0, 1, 1],
[1, 1, 1, 0, 1],
[1, 1, 1, 1, 0]]
rw_kernel_bl = RandomWalk(method_type="baseline", lamda=0.01)
rw_kernel_f = RandomWalk(lamda=0.01)
print(rw_kernel_bl.fit_transform([[B]])) # [[29.76190476]] -> [[1.0]] after normalization
print(rw_kernel_f.fit_transform([[B]])) # [[29.76190476]] -> [[1.0]] after normalization
Please install the latest grakel as I spotted an incosistency with the baseline.
Thanks a lot for taking our library into consideration 👍
from grakel.
Got it. New version installed and example working. The only difference to your example is that the result of print(rw_kernel_f.fit_transform([[B]]))
is [[0.04761905]]
.
Thank you very much for your support and for the library!
from grakel.
Related Issues (20)
- Print <class 'grakel.graph.Graph'>
- The Weisfeiler-Lehman Edge Kernel
- fetch_dataset not working HOT 1
- Graph hopper kernel unable to transfom the data
- Edge labels not working for custom dataset HOT 1
- Fingerprint dataset not accessible using fetch_dataset function HOT 13
- NaN error when using Random walk kernel on certain datasets HOT 3
- I don't know how to use my own data for input HOT 5
- MultiDiGraph: graph_from_networkx() ValueError HOT 1
- modified random walk kernel giving all 1 scores for normalize=true HOT 1
- Difference between ShortestPath and ShortestPathAttr HOT 2
- Generating graphs from dense/numpy matrices HOT 1
- Graph.clone() or Graph.copy() HOT 3
- Explicit graph kernels HOT 2
- Graphlet kernel HOT 1
- NeighborhoodSubgraphPairwiseDistance kernel returns diagonal elements less than 1 HOT 5
- One vs many comparison for WeisfeilerLehman; `.transform` gives `TypeError: each element of X must have either a graph with...` HOT 1
- RWK matrix returns by fit_transform by RandomWalkLabeled() contains only 1.0 HOT 7
- Error when using EdgeHistogram HOT 1
- Can't install on Windows 10, keep getting same error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grakel.