ysig / GraKeL

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

Using Graph Kernels for regression #26

Closed sbhttchryy closed 4 years ago

sbhttchryy commented 4 years ago

First, thank you very much for this wonderful library. I am a beginner in graph kernels, and I have a question. Is there any way to use these graph kernels for regression tasks? Thank you very much again.

giannisnik commented 4 years ago

Hi @sbhttchryy . Thank you for your interest in our library.

With regards to your question, the answer is yes, you can also perform regression tasks. You still create the kernel matrices using some graph kernel, and then instead of the SVM classifier, you pass these matrices on to the SVR algorithm (see here: https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVR.html). Note that you still need to set the "kernel" attribute of SVR equal to "precomputed".