On 11/08/2011 08:18 PM, Matt Henderson wrote:
So if I have a custom kernel function: CustomKernel(x, y) - I should do something like:


M = CustomKernel(model.support_vectors_, X)
# if X is a matrix where the rows are test vectors
results = model.predict_proba(M)

Actually, I haven't done this with sklearn yet ;)
But I think that should do it.
?
Is there an example of this somewhere?

Here is an example, but using a python function,
not a gram matrix.: http://scikit-learn.sourceforge.net/dev/auto_examples/svm/plot_custom_kernel.html#example-svm-plot-custom-kernel-py
And documentation here, though:
http://scikit-learn.sourceforge.net/dev/modules/svm.html#kernel-functions

This definitely needs more documentation. I'll see if I can whip something up tomorrow.
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to