Code Monkey home page Code Monkey logo

Comments (3)

giannisnik avatar giannisnik commented on June 15, 2024 1

You can have a list G_query that contains only the query graph, and a list G_corpus that contains the corpus graphs. Then, you can do the following:
gk = ShortestPath(normalize=True)
gk.fit(G_query)
K = gk.transform(G_corpus)
Matrix K will be an n x 1 matrix (where n is the number of corpus graphs), and will contain the kernel values between the query graph and all the corpus graphs.

from grakel.

giannisnik avatar giannisnik commented on June 15, 2024

Dear @kgoyal98 ,

If I understand correctly, what you want to do is to compare two graphs (the 1st and the 2nd) of the test set to each other. You can do this as follows:
kernel_val = gk.fit_transform(G_test[:2])[0,1]

If, on the other hand, you just want to generate the kernel matrix for the test samples, you can do the following:
K_test = gk.transform(G_test)

from grakel.

kgoyal98 avatar kgoyal98 commented on June 15, 2024

Is there no other way? Actually I wanted to compare one query graph with many other corpus graphs. One way is to add the query graph in list of corpus graphs and compute the kernel matrix of the resultant list. But, this will mean greater computational complexity (by a factor of number of corpus graphs).

from grakel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.