trthatcher / MLKernels.jl

Machine learning kernels in Julia.
http://trthatcher.github.io/MLKernels.jl/dev/
MIT License
78 stars 37 forks source link

kernelmatrix function #42

Closed sivapvarma closed 7 years ago

sivapvarma commented 8 years ago
screenshot 2016-06-30 01 26 14

I also get this error with kernel function sometimes.

trthatcher commented 8 years ago

Hi there

I'd be cautious with Pkg.checkout, as it will pull the latest version of the package which may not be stable. I'm making a number of changes to the package, so I would recommend using the tagged versions you get from the Julia metadata repo.

It looks like X is an array of integers. The kernel matrix methods only operate on floating points, so you can convert it to an array of floats instead:

kernelmatrix(gauss_kernel, convert(Matrix{eltype(gauss_kernel)}, X))

I'll add some methods to do this implicitly in the next release!

trthatcher commented 7 years ago

Working in master now:

using MLKernels
X = rand(Int64, 100, 5) % 5;
gauss_kernel = GaussianKernel(2);
K = kernelmatrix(gauss_kernel, X)
kskyten commented 7 years ago

This only works in dev for me. Maybe you forgot to push a commit?