You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

deltaKernel.py 562 B

123456789101112131415161718
  1. def deltakernel(condition):
  2. """Return 1 if condition holds, 0 otherwise.
  3. Parameters
  4. ----------
  5. condition : Boolean
  6. A condition, according to which the kernel is set to 1 or 0.
  7. Return
  8. ------
  9. kernel : integer
  10. Delta kernel.
  11. References
  12. ----------
  13. [1] H. Kashima, K. Tsuda, and A. Inokuchi. Marginalized kernels between labeled graphs. In Proceedings of the 20th International Conference on Machine Learning, Washington, DC, United States, 2003.
  14. """
  15. return (1 if condition else 0)

A Python package for graph kernels, graph edit distances and graph pre-image problem.