Skip to content

In gaussian_process/kernels.py, the Tanimoto kernel would be welcome #29507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
UnixJunkie opened this issue Jul 17, 2024 · 5 comments
Closed
Labels
Needs Triage Issue requires triage New Feature

Comments

@UnixJunkie
Copy link
Contributor

Describe the workflow you want to enable

Here is a formula:
xy / (||x||^2 + ||y||^2 - xY)

Describe your proposed solution

In the context of Gaussian Process Regression, maybe this should be multiplied by the variance,
so the formula becomes:
v * (xy / (||x||^2 + ||y||^2 - xY))

Describe alternatives you've considered, if relevant

Implement a new kernel myself, but since implementation of a kernel requires much more than just
a K method (evaluate the kernel), I find this way too dangerous.

Additional context

No response

@UnixJunkie UnixJunkie added Needs Triage Issue requires triage New Feature labels Jul 17, 2024
@adrinjalali
Copy link
Member

Thanks for the report. But from your description it's not clear to me what you're intending to change. It seems to me writing a custom kernel is exactly designed for these cases.

So closing as out of scope, but happy to reopen if more context is given.

@adrinjalali adrinjalali closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
@UnixJunkie
Copy link
Contributor Author

Could a scikit-learn hacker provide an implementation of the Tanimoto kernel?
Since scikit-learn's kernel template requires much more than just implementing the K method (i.e. score a pair of instances), this is super annoying for potential users who are not numerical maths researchers familiar w/ the scikit-learn codebase.

@UnixJunkie
Copy link
Contributor Author

The Tanimoto kernel is for instances which are bitstrings.
The more general version of this kernel is called the Jaccard index (cf. https://en.wikipedia.org/wiki/Jaccard_index).
The Jaccard index can handle bitstrings but also vectors of positive integers, so it might be potentially useful to more scikit-learn users.

@UnixJunkie
Copy link
Contributor Author

Please reopen this issue.

@UnixJunkie
Copy link
Contributor Author

There are some interesting kernels implemented in there:
https://github.com/AustinT/sklearn_tanimoto_gp/blob/main/sklearn_tanimoto_gp/kernels.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Triage Issue requires triage New Feature
Projects
None yet
Development

No branches or pull requests

2 participants