Skip to content

Conversation

@amueller
Copy link
Member

This segfaults atm :-/
Also, needs more testing.

Not really on my todo list, could be a basis for someone to work on this.

@fabianp
Copy link
Member

fabianp commented Jul 11, 2012

looks good to me.This adds support for custom kernels in the sparse case and I don't see any side-effects.

Merging ...

@fabianp
Copy link
Member

fabianp commented Jul 11, 2012

ok to merge @amueller (I just noticed the WIP the title)?

@amueller
Copy link
Member Author

@fabianp No, sorry, it is not. As I mentioned in the description above, this produces random segfaults and needs more work. See #918.
One needs to get the number of support vectors, for which there is no function yet, to copy the dual coefficients etc.

This is not really on my todo list atm, feel free to have a go.

@amueller
Copy link
Member Author

Basically the cython side is not able to handle precomputed kernels in the sparse case.

@amueller
Copy link
Member Author

@fabianp any help would be appreciated with this.
It seems to me there is some low-level wrapper coding to do.
In the sparse case, there is no way to create the kernel-indices (yet).
Looking at Kernel::precomputed_kernel in svm.cpp, I tried just stacking them to the front, but I get very weird results.
When I look into svm_csr_node, everything seems fine, but when I look into kernel_precomputed the values have changed?! any idea where this comes from?

@amueller
Copy link
Member Author

There is also this comment:
/* in the case of precomputed kernels we do not use
dense_to_precomputed because we don't want the leading 0. As
indices start at 1 (not at 0) this will work */
which I must admit is not entirely clear to me. This is in the svm_csr_model function.

@amueller amueller closed this Aug 26, 2012
@amueller
Copy link
Member Author

Closing as we don't really need sparse kernels. We need being able to use sparse X to precompute a dense kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants